• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ INDEXTOSTATEIMAGEMASK函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中INDEXTOSTATEIMAGEMASK函数的典型用法代码示例。如果您正苦于以下问题:C++ INDEXTOSTATEIMAGEMASK函数的具体用法?C++ INDEXTOSTATEIMAGEMASK怎么用?C++ INDEXTOSTATEIMAGEMASK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了INDEXTOSTATEIMAGEMASK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TreeList_Update

void TreeList_Update(HWND hwnd)
{
	TTreeList_Data *data = (TTreeList_Data *)sttTreeList_GeWindowData(hwnd);
	HTREELISTITEM hItem = data->root;
	int sortIndex = 0;

	SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
	if (data->sortMode)
		TreeList_RecursiveApply(hItem, sttTreeList_SortItems, (LPARAM)data->sortMode);
	TreeList_RecursiveApply(hItem, sttTreeList_ResetIndex, (LPARAM)&sortIndex);
	if (data->filter)
		TreeList_RecursiveApply(hItem, sttTreeList_FilterItems, (LPARAM)data->filter);
	for (int i = ListView_GetItemCount(hwnd); i--;) {
		LVITEM lvi = {0};
		lvi.mask = LVIF_PARAM;
		lvi.iItem = i;
		lvi.iSubItem = 0;
		ListView_GetItem(hwnd, &lvi);

		HTREELISTITEM ptli = (HTREELISTITEM)lvi.lParam;
		if ((ptli->flags & TLIF_VISIBLE) && (!data->filter || (ptli->flags & TLIF_FILTERED))) {
			ptli->flags |= TLIF_HASITEM;
			if (ptli->flags & TLIF_MODIFIED) {
				lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE | LVIF_TEXT;
				lvi.iItem = i;
				lvi.iSubItem = 0;
				lvi.pszText = ptli->text[0];
				lvi.stateMask = LVIS_OVERLAYMASK|LVIS_STATEIMAGEMASK;
				lvi.iImage = ptli->iIcon;
				if (data->mode == TLM_TREE)
					lvi.state =
						INDEXTOSTATEIMAGEMASK(
						((ptli->subItems.getCount() == 0) && !(ptli->flags & TLIF_FAKEPARENT)) ? 0 :
						(ptli->flags & TLIF_EXPANDED) ? 1 : 2) |
						INDEXTOOVERLAYMASK(ptli->iOverlay);
				else
					lvi.state =
						INDEXTOSTATEIMAGEMASK(
						((ptli->subItems.getCount() == 0) && !(ptli->flags & TLIF_FAKEPARENT)) ? 0 : 3) |
						INDEXTOOVERLAYMASK(ptli->iOverlay);

				ListView_SetItem(hwnd, &lvi);
				for (int j = 1; j < ptli->text.getCount(); ++j)
					ListView_SetItemText(hwnd, i, j, ptli->text[j]);
			}
		}
		else ListView_DeleteItem(hwnd, i);
	}
	if (data->mode == TLM_TREE)
		TreeList_RecursiveApply(hItem, sttTreeList_CreateItems, (LPARAM)hwnd);
	else {
		for (int i = data->hItemSelected->subItems.getCount(); i--;)
			sttTreeList_CreateItems_List(data->hItemSelected->subItems[i], (LPARAM)hwnd);
		for (HTREELISTITEM hItem = data->hItemSelected; !(hItem->flags & TLIF_ROOT); hItem = hItem->parent)
			sttTreeList_CreateItems_List(hItem, (LPARAM)hwnd);
	}
	ListView_SortItems(hwnd, sttTreeList_SortFunc, 0);
	SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
	UpdateWindow(hwnd);
}
开发者ID:martok,项目名称:miranda-ng,代码行数:60,代码来源:jabber_treelist.cpp


示例2: switch

void CComplexSymbolLayerCtrl::AddItem(int nIndex, int nState)
{
	LV_ITEM lvi;
	lvi.mask =  LVIF_IMAGE|LVIF_STATE;
	lvi.iItem = nIndex;
	lvi.iSubItem = 0;
	lvi.iImage = nIndex;
	lvi.pszText = "";
	lvi.stateMask =  LVIS_STATEIMAGEMASK|LVIS_DROPHILITED;

	switch(nState)
	{
	case 1:
		lvi.state = INDEXTOSTATEIMAGEMASK( 1 );
		break;
	case 2:
		lvi.state =INDEXTOSTATEIMAGEMASK( 2 );
		break;
	case 3:
		lvi.state = INDEXTOSTATEIMAGEMASK( 3 )|LVIS_DROPHILITED ;
		break;
	case 4:
		lvi.state = INDEXTOSTATEIMAGEMASK( 4 )|LVIS_DROPHILITED;
		break;
	}

	InsertItem( &lvi );
}
开发者ID:lozpeng,项目名称:applesales,代码行数:28,代码来源:ComplexSymbolLayerCtrl.cpp


示例3: INDEXTOSTATEIMAGEMASK

void CIVRuleDlg::OnRuleUse()
{
    if ( CIVRuleCfgDoc::IsUse(m_nCurrentChan) )
    {
        CIVRuleCfgDoc::Use(m_nCurrentChan,false); 
        m_CameraTree.SetItemState(
            m_ClickItem, 
            INDEXTOSTATEIMAGEMASK(1), 
            TVIS_STATEIMAGEMASK ); 
    }
    else
    {
        if ( g_IIVDeviceBase2->IsHaveFreeDevice() )
        {
            CIVRuleCfgDoc::Use(m_nCurrentChan,true);
            m_CameraTree.SetItemState(
                m_ClickItem, 
                INDEXTOSTATEIMAGEMASK(2), 
                TVIS_STATEIMAGEMASK ); 
        }
        else
        {
            MessageBox(
                _T("Is not enought IV Channel, You Must Stop Other IV Channel First!"));
        }
    }
}
开发者ID:fatrar,项目名称:yiqiulib,代码行数:27,代码来源:IVRuleDlg.cpp


示例4: onItemChanged

// Clicked 'Active' check box
LRESULT ADLSearchFrame::onItemChanged(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/)
{
    NM_LISTVIEW* lv = (NM_LISTVIEW*) pnmh;
    ::EnableWindow(GetDlgItem(IDC_EDIT), (lv->uNewState & LVIS_FOCUSED));
    ::EnableWindow(GetDlgItem(IDC_REMOVE), (lv->uNewState & LVIS_FOCUSED));

    NMITEMACTIVATE* item = (NMITEMACTIVATE*)pnmh;

    if((item->uChanged & LVIF_STATE) == 0)
        return 0;
    if((item->uOldState & INDEXTOSTATEIMAGEMASK(0xf)) == 0)
        return 0;
    if((item->uNewState & INDEXTOSTATEIMAGEMASK(0xf)) == 0)
        return 0;

    if(item->iItem >= 0)
    {
        // Set new active status check box
        /*ADLSearchManager::SearchCollection& collection = ADLSearchManager::getInstance()->collection;
        ADLSearch* search = collection[item->iItem];
        search->isActive = (ctrlList.GetCheckState(item->iItem) != 0);*/
        ADLSearchManager::getInstance()->changeState(item->iItem, ctrlList.GetCheckState(item->iItem) != 0);
    }
    return 0;
}
开发者ID:BackupTheBerlios,项目名称:airdc-svn,代码行数:26,代码来源:ADLSearchFrame.cpp


示例5: GetListCtrl

void CRowListView::CheckItem(int nNewCheckedItem)
{
	CListCtrl& ListCtrl = GetListCtrl();

// reset if there is checked item

	if (m_nCheckedItem != -1)
	{
		if (m_bStateIcons)
		{
			ListCtrl.SetItemState(m_nCheckedItem,
				INDEXTOSTATEIMAGEMASK(1), LVIS_STATEIMAGEMASK);
		}
		else
		{
			ListCtrl.SetItemState(m_nCheckedItem,
				INDEXTOSTATEIMAGEMASK(1),
				LVIS_STATEIMAGEMASK | LVIS_OVERLAYMASK);
		}

		::DestroyIcon(m_hSmallIcon);
		::DestroyIcon(m_hLargeIcon);
	}

// check new item and set its icon as the app icon

	CWnd* pMainWnd = AfxGetMainWnd();

	if (m_nCheckedItem == nNewCheckedItem)
	{
		m_nCheckedItem = -1;
		pMainWnd->SetIcon(NULL, FALSE);
		pMainWnd->SetIcon(NULL, TRUE);
	}
	else if ((m_nCheckedItem = nNewCheckedItem) != -1)
	{
		if (m_bStateIcons)
		{
			ListCtrl.SetItemState(m_nCheckedItem,
				INDEXTOSTATEIMAGEMASK(2), LVIS_STATEIMAGEMASK);
		}
		else
		{
			ListCtrl.SetItemState(m_nCheckedItem,
				INDEXTOSTATEIMAGEMASK(2) | INDEXTOOVERLAYMASK(1),
				LVIS_STATEIMAGEMASK | LVIS_OVERLAYMASK);
		}

		m_hSmallIcon =
			ListCtrl.GetImageList(LVSIL_SMALL)->ExtractIcon(nNewCheckedItem);
		pMainWnd->SetIcon(m_hSmallIcon,FALSE);
		m_hLargeIcon =
			ListCtrl.GetImageList(LVSIL_NORMAL)->ExtractIcon(nNewCheckedItem);
		pMainWnd->SetIcon(m_hLargeIcon,TRUE);
	}
}
开发者ID:jetlive,项目名称:skiaming,代码行数:56,代码来源:rlistvw.cpp


示例6: GetParent

void KUIMulStatusTree::TravelChild(HTREEITEM hItem, int nCheck)
{
    HTREEITEM hChildItem   = NULL;
    HTREEITEM hBrotherItem = NULL;;
    HWND hParent = GetParent();
    UINT nState  = 0;


    //查找子节点,没有就结束
    hChildItem = GetChildItem(hItem);

    int nChildCheck = nCheck;
    GetCheck(hChildItem,nChildCheck);

    if(hChildItem != NULL && nChildCheck != KUIMulStatusTree::EM_TVIS_NONE)
    {
        //设置子节点的状态与当前节点的状态一致
        nState = GetItemState(hChildItem, TVIS_STATEIMAGEMASK);
        if (nState != INDEXTOSTATEIMAGEMASK(nCheck))
        {        
            SetItemState(hChildItem, INDEXTOSTATEIMAGEMASK(nCheck), TVIS_STATEIMAGEMASK);
//             if (hParent != NULL)
//             {
//                 ::SendMessage(hParent, WM_KAN_NOTIFY_TREE_CHECKED_CHANGE, (WPARAM)hChildItem, (LPARAM)nCheck);
//             }
        }

        //再递归处理子节点的子节点和兄弟节点
        TravelChild(hChildItem, nCheck);

        //处理子节点的兄弟节点和其子节点
        hBrotherItem = GetNextSiblingItem(hChildItem);

        while (hBrotherItem)
        {
            //设置子节点的兄弟节点状态与当前节点的状态一致
            nState = GetItemState(hBrotherItem, TVIS_STATEIMAGEMASK);
            int nBrotherCheck = nCheck;
            GetCheck(hBrotherItem,nBrotherCheck);
            if (nState != INDEXTOSTATEIMAGEMASK(nCheck) && nBrotherCheck != KUIMulStatusTree::EM_TVIS_NONE)
            {        
                SetItemState(hBrotherItem, INDEXTOSTATEIMAGEMASK(nCheck), TVIS_STATEIMAGEMASK);
//                 if (hParent != NULL)
//                 {
//                     ::SendMessage(hParent, WM_KAN_NOTIFY_TREE_CHECKED_CHANGE, (WPARAM)hBrotherItem, (LPARAM)nCheck);
//                 }
            }

            //再递归处理子节点的兄弟节点的子节点和兄弟节点
            TravelChild(hBrotherItem, nCheck);

            hBrotherItem = GetNextSiblingItem(hBrotherItem);
        }
    }
}
开发者ID:6520874,项目名称:pcmanager,代码行数:55,代码来源:kuimulstatustree.cpp


示例7: switch

void CTracksSerializerDlg::OnLvnGetdispinfoTracklist(NMHDR *pNMHDR, LRESULT *pResult)
{
	NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
	//Create a pointer to the item
	LV_ITEM* pItem= &(pDispInfo->item);

	//Which item number?
	int itemid = pItem->iItem;

	TCHAR bf[20];
	//Do the list need text information?
	if (pItem->mask & LVIF_TEXT)
	{
		LPCTSTR str = NULL;
		switch (pItem->iSubItem)
		{
		case 0:		str = m_ItemsURL[itemid].c_str();				break;
		case 1:		str = m_ItemsTagInfo[itemid].Title.c_str();		break;
		case 2:		str = m_ItemsTagInfo[itemid].Artist.c_str();	break;
		case 3:		str = m_ItemsTagInfo[itemid].Album.c_str();		break;
		case 4:		
			PrgAPI::FormatDuration(bf, 20, m_ItemsTagInfo[itemid].Length);
			str = bf;
			break;
		case 5:		str = m_ItemsTagInfo[itemid].Genre.c_str();		break;
		}


		//Copy the text to the LV_ITEM structure
		//Maximum number of characters is in pItem->cchTextMax
		lstrcpyn(pItem->pszText, str, pItem->cchTextMax);
	}

	//Do the list need image information?
	if( pItem->mask & LVIF_IMAGE) 
	{
		pItem->mask |= LVIF_STATE;
		pItem->stateMask = LVIS_STATEIMAGEMASK;
		if(m_ItemsChecked[itemid])
		{
			//Turn check box on
			pItem->state = INDEXTOSTATEIMAGEMASK(2);
		}
		else
		{
			//Turn check box off
			pItem->state = INDEXTOSTATEIMAGEMASK(1);
		}
	}

	*pResult = 0;

}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:53,代码来源:TracksSerializerDlg.cpp


示例8: StartTimer

void CWallChangerDlg::OnLvnItemchangedListClass(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);

	if (!pNMLV)
		return;

	if (m_bInit && (pNMLV->uOldState==INDEXTOSTATEIMAGEMASK(1)) && (pNMLV->uNewState==INDEXTOSTATEIMAGEMASK(2))) {
		// Check this Item
		bool bEmptyEnable = (::g_pWallEnablePicList->GetCount() == 0);
		m_listClass.SetItemEnable(pNMLV->iItem, true);
		if (bEmptyEnable && ::g_pWallEnablePicList->GetCount())
			StartTimer();
		m_listClass.SetIniModify();
	} else if (m_bInit && (pNMLV->uOldState==INDEXTOSTATEIMAGEMASK(2)) && (pNMLV->uNewState==INDEXTOSTATEIMAGEMASK(1))) {
		// UnCheck this Item
		m_listClass.SetItemEnable(pNMLV->iItem, false);
		if (::g_pWallEnablePicList->GetCount() == 0)
			StopTimer();
		m_listClass.SetIniModify();
	} else {
		// Change Select Items
		int iSelCount = m_listClass.GetSelectedCount();
		if (iSelCount == 1) {
			if (m_pCurListDirPath)
				m_pCurListDirPath->ShowWindow(SW_HIDE);
			else
				m_listDirPath.ShowWindow(SW_HIDE);

			CWallClassListItem *pListItem = (CWallClassListItem *)m_listClass.GetFirstSelectedItemLParam();
			if (pListItem)
				m_pCurListDirPath = (CWallDirListCtrl *)pListItem->GetChildDirList();
			if (m_pCurListDirPath) {
				CRect rcDirList;
				m_listDirPath.GetWindowRect(rcDirList);

				ScreenToClient(rcDirList);
				m_pCurListDirPath->MoveWindow(rcDirList);
				m_pCurListDirPath->ShowWindow(SW_SHOW);
			}
		} else {
			if (m_pCurListDirPath) {
				m_pCurListDirPath->ShowWindow(SW_HIDE);
				m_pCurListDirPath = NULL;
			}
			m_listDirPath.ShowWindow(SW_SHOW);
		}
	}

	*pResult = 0;
}
开发者ID:tsaikd,项目名称:MagicKD,代码行数:51,代码来源:WallChangerDlg.cpp


示例9: PopulateProtocolList

void PopulateProtocolList(HWND hWnd)
{
	bool useOne = IsDlgButtonChecked(hWnd, IDC_USEBYPROTOCOL) == BST_UNCHECKED;

	HWND hLstView = GetDlgItem(hWnd, IDC_PROTOLIST);

	TreeView_DeleteAllItems(hLstView);

	TVINSERTSTRUCT tvi = {0};
	tvi.hParent = TVI_ROOT;
	tvi.hInsertAfter = TVI_LAST;
	tvi.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_STATE | TVIF_SELECTEDIMAGE;
	tvi.item.stateMask = TVIS_STATEIMAGEMASK;

	NudgeElementList *n;
	int i = 0;
	if (GlobalNudge.useByProtocol)
	{
		#ifdef _UNICODE
		wchar_t buff[256];
		#endif
		for(n = NudgeList;n != NULL; n = n->next)
		{
			#ifdef _UNICODE
				MultiByteToWideChar(CP_ACP, 0, n->item.ProtocolName, -1, buff, 256);
				tvi.item.pszText = buff;
			#else
				tvi.item.pszText = n->item.ProtocolName;
			#endif
			tvi.item.iImage  = i;
			n->item.iProtoNumber = i;
			tvi.item.iSelectedImage = i;
			tvi.item.state = INDEXTOSTATEIMAGEMASK(n->item.enabled?2:1);	
			TreeView_InsertItem(hLstView, &tvi);
			i++;
		}
	}
	else
	{
		tvi.item.pszText = TranslateT("Nudge");
		tvi.item.iImage  = nProtocol;
		DefaultNudge.iProtoNumber = nProtocol;
		tvi.item.iSelectedImage = nProtocol;
		tvi.item.state = INDEXTOSTATEIMAGEMASK(DefaultNudge.enabled?2:1);	
		TreeView_InsertItem(hLstView, &tvi);

	}
	TreeView_SelectItem(hLstView, TreeView_GetRoot(hLstView));
	//TreeView_SetCheckState(hLstView, TreeView_GetRoot(hLstView), TRUE)
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:50,代码来源:options.cpp


示例10: switch

void CHistoryBar::OnGetdispinfoList(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NMLVDISPINFO* pDispInfo = (NMLVDISPINFO*)pNMHDR;
	LVITEM&	item = pDispInfo->item;
	CUndoManager	*UndoMgr = theApp.GetMain()->GetUndoManager();
	if (UndoMgr == NULL)	// if no documents
		return;
	*pResult = 0;
	if (item.mask & LVIF_TEXT) {
		switch (item.iSubItem) {
		case COL_ACTION:
			{
				CString	s;
				if (item.iItem) {
					CWaveShopView	*View = theApp.GetMain()->GetView();
					// items are offset by one to make room for initial state
					s = View->GetUndoTitle(UndoMgr->GetState(item.iItem - 1));
				} else	// item zero is initial state
					s.LoadString(IDS_HIST_INITIAL_STATE);
				_tcsncpy(item.pszText, s, item.cchTextMax);
			}
			break;
		}
	}
	if (item.mask & LVIF_IMAGE) {
		switch (item.iSubItem) {
		case COL_ACTION:
			item.mask |= LVIF_STATE;
			item.state = INDEXTOSTATEIMAGEMASK(item.iItem == UndoMgr->GetPos());
			item.stateMask = LVIS_STATEIMAGEMASK;
			break;
		}
	}
}
开发者ID:victimofleisure,项目名称:WaveShop,代码行数:34,代码来源:HistoryBar.cpp


示例11: INDEXTOSTATEIMAGEMASK

void MainWindowPageScripts::ScriptToList(const uint8_t &ui8ScriptId, const bool &bInsert, const bool &bSelected) {
    bIgnoreItemChanged = true;

    LVITEM lvItem = { 0 };
    lvItem.mask = LVIF_PARAM | LVIF_TEXT;
    lvItem.iItem = ui8ScriptId;
    lvItem.pszText = ScriptManager->ScriptTable[ui8ScriptId]->sName;
    lvItem.lParam = (LPARAM)ScriptManager->ScriptTable[ui8ScriptId];

    if(bSelected == true) {
        lvItem.mask |= LVIF_STATE;
        lvItem.state = LVIS_SELECTED;
        lvItem.stateMask = LVIS_SELECTED;
    }

    int i = -1;
    
    if(bInsert == true) {
        i = (int)::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_INSERTITEM, 0, (LPARAM)&lvItem);
    } else {
        i = (int)::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_SETITEM, 0, (LPARAM)&lvItem);
    }

    if(i != -1 || bInsert == false) {
        lvItem.mask = LVIF_STATE;
        lvItem.state = INDEXTOSTATEIMAGEMASK(ScriptManager->ScriptTable[ui8ScriptId]->bEnabled == true ? 2 : 1);
        lvItem.stateMask = LVIS_STATEIMAGEMASK;

        ::SendMessage(hWndPageItems[LV_SCRIPTS], LVM_SETITEMSTATE, ui8ScriptId, (LPARAM)&lvItem);
    }

    bIgnoreItemChanged = false;
}
开发者ID:anandanwar4,项目名称:PtokaX,代码行数:33,代码来源:MainWindowPageScripts.cpp


示例12: Tree_AddExtraIconGroup

	HTREEITEM Tree_AddExtraIconGroup(intlist &group, bool selected, HTREEITEM hAfter = TVI_LAST)
	{
		intlist *ids = new intlist();
		CMString desc;
		int img = 0;
		for (int i = 0; i < group.count; i++) {
			BaseExtraIcon *extra = registeredExtraIcons[group.data[i] - 1];
			ids->add(extra->getID());

			if (img == 0 && !IsEmpty(extra->getDescIcon()))
				img = extra->getID();

			if (i > 0)
				desc += _T(" / ");
			desc += extra->getDescription();
		}

		TVINSERTSTRUCT tvis = { 0 };
		tvis.hInsertAfter = hAfter;
		tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
		tvis.item.stateMask = TVIS_STATEIMAGEMASK;
		tvis.item.iSelectedImage = tvis.item.iImage = img;
		tvis.item.lParam = (LPARAM)ids;
		tvis.item.pszText = (TCHAR*)desc.c_str();
		tvis.item.state = INDEXTOSTATEIMAGEMASK(selected ? 2 : 1);
		return m_tree.InsertItem(&tvis);
	}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:27,代码来源:options_ei.cpp


示例13: ATLASSERT

BOOL KUIMulStatusTree::SetCheck(
    HTREEITEM hItem, 
    int  nCheck, 
    BOOL bUpdate /* = TRUE */)
{
    ATLASSERT(hItem  != NULL);
    ATLASSERT(m_hWnd != NULL);

    TV_ITEM tvi;
    ZeroMemory(&tvi, sizeof(tvi));

    tvi.hItem = hItem;
    tvi.mask  = TVIF_STATE;
    tvi.stateMask = TVIS_STATEIMAGEMASK;

    ATLASSERT((nCheck >= EM_TVIS_NONE) && (nCheck <= EM_TVIS_CHECK));

    tvi.state = INDEXTOSTATEIMAGEMASK(nCheck);

    if (!TreeView_SetItem(m_hWnd, &tvi))
        return FALSE;

    if (nCheck != EM_TVIS_NONE)
    {    
        if (bUpdate)
            TravelChild(hItem, nCheck);

        TravelSiblingAndParent(hItem, nCheck);
    } // if (nCheck != EM_TVIS_NONE)    

    return TRUE;
}
开发者ID:6520874,项目名称:pcmanager,代码行数:32,代码来源:kuimulstatustree.cpp


示例14: INDEXTOSTATEIMAGEMASK

void Settings::DlgInsertTeam(HWND hwnd, const std::string& team, const std::string& section) {
  if (dialog_data_.teams_.find(team) != dialog_data_.teams_.end())
    return;

  if (dialog_data_.sections_.find(section) == dialog_data_.sections_.end()) {
		TVINSERTSTRUCTA tvi;
		tvi.hParent = 0;
		tvi.hInsertAfter = TVI_LAST;
		tvi.itemex.mask = TVIF_TEXT;
		tvi.itemex.pszText = const_cast<char*>(section.c_str());
    dialog_data_.sections_[section] = (HTREEITEM)SendMessageA((hwnd), TVM_INSERTITEMA, 0, (LPARAM)&tvi);
	}

  HTREEITEM parent = dialog_data_.sections_[section];

	{
		TVINSERTSTRUCTA tvi;
		tvi.hParent = parent;
		tvi.hInsertAfter = TVI_LAST;
		tvi.itemex.mask = TVIF_TEXT  | TVIF_STATE;
		tvi.itemex.state =  INDEXTOSTATEIMAGEMASK((IsTeamFavorite(team) ? 2 : 1));
		tvi.itemex.stateMask = TVIS_STATEIMAGEMASK;
		tvi.itemex.pszText = const_cast<char*>(team.c_str());
    dialog_data_.teams_[team] = (HTREEITEM)SendMessageA((hwnd), TVM_INSERTITEMA, 0, (LPARAM)&tvi);
		TreeView_Expand(hwnd, parent, TVE_EXPAND);
	}
}
开发者ID:frippery,项目名称:teamleagueplugin,代码行数:27,代码来源:settings.cpp


示例15: ASSERT_VALID

int CLiveItem::Add(CListCtrl* pCtrl, int nItem, int nColumns)
{
	ASSERT_VALID( this );
	ASSERT_VALID( pCtrl );

	LV_ITEM pItem = {};
	pItem.mask		= LVIF_PARAM|LVIF_TEXT|LVIF_STATE;
	pItem.iItem		= nItem >= 0 ? nItem : pCtrl->GetItemCount();
	if ( m_nImage[ 0 ] >= 0 )
	{
		pItem.mask |= LVIF_IMAGE;
		pItem.iImage = m_nImage[ 0 ];
	}
	pItem.lParam	= (LPARAM)m_nParam;
	pItem.state		= INDEXTOOVERLAYMASK( m_nMaskOverlay ) | INDEXTOSTATEIMAGEMASK( m_nMaskState );
	pItem.stateMask	= LVIS_OVERLAYMASK | LVIS_STATEIMAGEMASK;
	pItem.pszText	= (LPTSTR)(LPCTSTR)m_pColumn[0];
	pItem.iItem		= pCtrl->InsertItem( &pItem );
	if ( pItem.iItem != -1 )
	{
		for ( pItem.iSubItem = 1 ; pItem.iSubItem < nColumns ; pItem.iSubItem++ )
		{
			pItem.mask = LVIF_TEXT;
			pItem.pszText = (LPTSTR)(LPCTSTR)m_pColumn[ pItem.iSubItem ];
			if ( m_nImage[ pItem.iSubItem ] >= 0 )
			{
				pItem.mask |= LVIF_IMAGE;
				pItem.iImage = m_nImage[ pItem.iSubItem ];
			}
			VERIFY( pCtrl->SetItem( &pItem ) );
		}
	}

	return pItem.iItem;
}
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:35,代码来源:LiveList.cpp


示例16: UpdateData

void CWZStep3::OnAdd() 
{
	int nTotal,i;
	WCHAR szPath[MAX_PATH];
	CString strPath;
	UpdateData(TRUE);

	if (GetLongPathName(m_SourcePath.GetBuffer(0),szPath,MAX_PATH))
	{
		m_SourcePath = szPath;
		nTotal = m_SourceList.GetItemCount();
		for (i = 0;i < nTotal;i++)
		{
			strPath = m_SourceList.GetItemText(i,0);
			if (CheckConflict(strPath.GetBuffer(0),szPath,FALSE)) return;
			if (CheckConflict(szPath,strPath.GetBuffer(0),FALSE))
			{
				m_SourceList.DeleteItem(i);
				nTotal --;
				i --;
			}
		}
		m_SourceList.InsertItem(nTotal,m_SourcePath);
		m_SourceList.SetItem(nTotal,0,LVIF_STATE,L"",0,INDEXTOSTATEIMAGEMASK(1),LVIS_STATEIMAGEMASK,0);
	}
	else AfxMessageBox(IDS_INVALID_SOURCE,MB_OK | MB_ICONINFORMATION);
	// TODO: Add your control notification handler code here
	
}
开发者ID:xfxf123444,项目名称:japan,代码行数:29,代码来源:WZStep3.cpp


示例17: SetSelectionCheck

//
// Sets the specified tree item's check box to the specified state.
//
void CPageNetwork::SetSelectionCheck(HTREEITEM hitem, TargetSelType selection)
{
	// set the interface icon's associated state icon
	if (!m_TTargets.SetItemState(hitem, INDEXTOSTATEIMAGEMASK(selection), TVIS_STATEIMAGEMASK)) {
		ErrorMessage("SetItemState() failed in CPageNetwork::" "SetSelectionCheck()");
	}
}
开发者ID:BackupTheBerlios,项目名称:iometer-svn,代码行数:10,代码来源:PageNetwork.cpp


示例18: INDEXTOSTATEIMAGEMASK

void CUserManagePage::FillListCtrl()
{
	LV_ITEM lvi;
	int colnum = 2;
	m_listctrl.DeleteAllItems();
	char * query = "select USERNAME, USERGROUP.GROUPNAME from user join USERGROUP on USERGROUP.GROUPID=USER.USERGROUPID ";
    rst = CDbsource::GetDB().GerResult(query,colnum);
    int i = 0;
	m_box_user.ResetContent();
	for(list<CString>::iterator It=rst->begin();It!=rst->end();It++)
	{
		lvi.mask = LVIF_TEXT | LVIF_STATE;
		lvi.iItem = i;
		lvi.iSubItem = 0;
		lvi.pszText = (*It).GetBuffer((*It).GetLength());
		lvi.stateMask = LVIS_STATEIMAGEMASK;
		lvi.state = INDEXTOSTATEIMAGEMASK(1);
		m_listctrl.InsertItem(&lvi);
		m_box_user.AddString((LPCTSTR)*It);
		for(int j = 1; j<colnum; j++)
		{
			m_listctrl.SetItemText(i,j,(LPCTSTR)*(++It));
		}
		i++;
	}
	colnum = 1;
	query  = "select USERGROUP.GROUPNAME from  USERGROUP";
    rst = CDbsource::GetDB().GerResult(query,colnum);
	m_box_role.ResetContent();
	for(list<CString>::iterator It=rst->begin();It!=rst->end();It++)
	{
		m_box_role.AddString((LPCTSTR)*It);
	}
}
开发者ID:bblr001,项目名称:MVS,代码行数:34,代码来源:UserManagePage.cpp


示例19: ASSERT_VALID

BOOL CLiveItem::Update(CListCtrl* pCtrl, int nItem, int nColumns)
{
	ASSERT_VALID( this );
	ASSERT_VALID( pCtrl );

	BOOL bModified = FALSE;

	LV_ITEM pMainItem = {
		LVIF_PARAM | LVIF_IMAGE | LVIF_STATE,
		nItem,
		0,
		0,
		LVIS_OVERLAYMASK|LVIS_STATEIMAGEMASK
	};

	if ( ! pCtrl->GetItem( &pMainItem ) || pMainItem.lParam != (LPARAM)m_nParam )
		return FALSE;

	if ( ( pMainItem.state & (LVIS_OVERLAYMASK|LVIS_STATEIMAGEMASK) ) != ( INDEXTOOVERLAYMASK( m_nMaskOverlay ) | INDEXTOSTATEIMAGEMASK( m_nMaskState ) ) )
	{
		pMainItem.state		= INDEXTOOVERLAYMASK( m_nMaskOverlay ) | INDEXTOSTATEIMAGEMASK( m_nMaskState );
		pMainItem.stateMask	= LVIS_OVERLAYMASK | LVIS_STATEIMAGEMASK;
		bModified = TRUE;
	}

	if ( bModified )
		VERIFY( pCtrl->SetItem( &pMainItem ) );

	CString buf;
	for ( int i = 0 ; i < nColumns ; ++i )
	{
		LV_ITEM pItem = { LVIF_IMAGE | LVIF_TEXT, nItem, i, 0, 0, buf.GetBuffer( 1024 ), 1024 };
		BOOL bResult = pCtrl->GetItem( &pItem );
		buf.ReleaseBuffer();
		if ( ! bResult )
			return FALSE;

		pItem.mask = 0;
		if ( ! pItem.pszText || m_pColumn[ pItem.iSubItem ] != pItem.pszText )
		{
			pItem.mask |= LVIF_TEXT;
			pItem.pszText = (LPTSTR)(LPCTSTR)m_pColumn[ pItem.iSubItem ];
		}

		if ( m_nImage[ pItem.iSubItem ] >= 0 &&
			 m_nImage[ pItem.iSubItem ] != pItem.iImage )
		{
			pItem.mask |= LVIF_IMAGE;
			pItem.iImage = m_nImage[ pItem.iSubItem ];
		}

		if ( pItem.mask )
		{
			VERIFY( pCtrl->SetItem( &pItem ) );
			bModified = TRUE;
		}
	}

	return bModified;
}
开发者ID:ivan386,项目名称:Shareaza,代码行数:60,代码来源:LiveList.cpp


示例20: INDEXTOSTATEIMAGEMASK

void
TLvItem::SetStateImage(int index)
{
  mask |= LVIF_STATE;
  stateMask |= LVIS_STATEIMAGEMASK;
  state = INDEXTOSTATEIMAGEMASK(index+1);
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:7,代码来源:listviewctrl.cpp



注:本文中的INDEXTOSTATEIMAGEMASK函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ INDIRECT函数代码示例发布时间:2022-05-30
下一篇:
C++ INDEXK函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap