当前位置: 首页>>代码示例>>C++>>正文


C++ ResetContent函数代码示例

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


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

示例1: ResetContent

void CTDLFindTaskAttributeComboBox::BuildCombo()
{
	ResetContent();

	CLocalizer::EnableTranslation(*this, FALSE);

	int nAttrib;
	for (nAttrib = 0; nAttrib < ATTRIB_COUNT; nAttrib++)
	{
		const TDCATTRIBUTE& ap = ATTRIBUTES[nAttrib];

		if (ap.nAttribResID)
		{
			CEnString sAttrib(ap.nAttribResID);
			DWORD dwItemData = EncodeItemData(ap.attrib, FALSE);

			int nItem = AddString(sAttrib); 
			SetItemData(nItem, dwItemData); 

			// is it a date
			// then add relative version too
			if (AttributeIsDate(ap.attrib))
			{
				dwItemData = EncodeItemData(ap.attrib, TRUE);

				sAttrib += ' ';
				sAttrib += CEnString(IDS_TDLBC_RELATIVEDATESUFFIX);

				nItem = AddString(sAttrib); 
				SetItemData(nItem, dwItemData); 
			}
		}
	}

	// custom attributes
	for (nAttrib = 0; nAttrib < m_aAttribDefs.GetSize(); nAttrib++)
	{
		const TDCCUSTOMATTRIBUTEDEFINITION& attribDef = m_aAttribDefs[nAttrib];
		CEnString sAttrib(IDS_CUSTOMCOLUMN, attribDef.sLabel);
		TDC_ATTRIBUTE attrib = attribDef.GetAttributeID();

		int nItem = AddString(sAttrib); 
		DWORD dwItemData = EncodeItemData(attrib, FALSE);

		SetItemData(nItem, dwItemData); 

		// is it a date
		if (AttributeIsDate(attrib))
		{
			dwItemData = EncodeItemData(attrib, TRUE);
			sAttrib.Format(IDS_CUSTOMRELDATECOLUMN, attribDef.sLabel);
			
			nItem = AddString(sAttrib); 
			SetItemData(nItem, dwItemData); 
		}
	}

	// recalc combo drop width
	CDialogHelper::RefreshMaxDropWidth(*this);
}
开发者ID:jithuin,项目名称:infogeezer,代码行数:60,代码来源:tdlfindtaskattributecombobox.cpp

示例2: ResetContent

// Updates the contents of the listbox
void CClassList::UpdateContents(BOOL bShowTemplates)
{
	CEditProjectMgr *pProject=GetProject();
	if(!pProject)
		return;

	// Remove the current contents
	ResetContent();

	// Add the classes to the listbox
	int i;
	for(i=0; i < pProject->m_nClassDefs; i++)
	{
		if (!(pProject->m_ClassDefs[i].m_ClassFlags & CF_HIDDEN))
		{
			AddString(pProject->m_ClassDefs[i].m_ClassName);
		}
	}

	// Include the template classes
	if (bShowTemplates)
	{
		for(i=0; i < pProject->m_TemplateClasses; i++)
		{
			AddString(pProject->m_TemplateClasses[i]->m_ClassName);			
		}
	}
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:29,代码来源:ClassList.cpp

示例3: ResetContent

BOOL CSearchBox::InitStocks( BOOL bHasSTTTech, BOOL bShowOnSel, BOOL bDuplicate )
{
	ResetContent( );

	m_bShowOnSel	=	bShowOnSel;

	CStockContainer & container	=	AfxGetStockContainer();
	InitStorage( bDuplicate ? container.GetSize()*2 : container.GetSize(), 32 );
	for( int i=0; i<container.GetSize(); i++ )
	{
		CStockInfo	& info	=	container.ElementAt(i);
		if( !info.IsValidStock() )
			continue;

		CString	strTemp	=	info.GetStockCode();
		while( strTemp.GetLength() < 8 )
			strTemp	+=	' ';
		strTemp	+=	info.GetStockName();
		int	nItem	=	AddString( strTemp );
		SetItemData( nItem, i );

		if( bDuplicate )
		{
			strTemp	=	info.GetStockShortName();
			while( strTemp.GetLength() < 8 )
				strTemp	+=	' ';
			strTemp	+=	info.GetStockName();
			if( CB_ERR == SelectString( 0, strTemp ) )
			{
				nItem = AddString( strTemp );
				SetItemData( nItem, i );
			}
		}
	}
	if( bHasSTTTech )
	{
		// 技术指标项
		UINT nTechUserCount = CTechUser::GetTechUserCount();
		for( UINT i=STT_MIN; i <= STT_MAX+nTechUserCount; i ++ )
		{
			UINT	nTech	=	i;
			if( nTech > STT_MAX )
				nTech	=	i-STT_MAX-1+STT_USER_MIN;
		
			CString	strTemp	=	AfxGetSTTShortName( nTech );
			while( strTemp.GetLength() < 8 )
				strTemp	+=	' ';
			strTemp	+=	AfxGetSTTName( nTech );
			int	nItem	=	AddString( strTemp );
			SetItemData( nItem, nTech | SEARCHBOX_SIGNBIT_STT );
		}
		// 快捷键项
		for( UINT i = ACCE_MIN; i <= ACCE_MAX; i++ )
		{
			CString	strTemp	=	AfxGetAccelerator( i, 8 );
			SetItemData( AddString(strTemp), i | SEARCHBOX_SIGNBIT_ACCE );
		}
	}
	return TRUE;
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:60,代码来源:SListCombos.cpp

示例4: ResetContent

void CBetPoolListBox::DeleteAllIndex()
{	
	for (int i=0; i< GetCount(); i++) {
		PoolBox_AppendData * pData = (PoolBox_AppendData *)GetItemDataPtr(i);
		if ( NULL != pData ) {
			delete pData->pSta0;
			pData->pSta0 = NULL ;

			delete pData->pBut2;
			pData->pBut2 = NULL ;

			delete pData->pSta1;
			pData->pSta1 = NULL ;

			delete pData->pSta3;
			pData->pSta3 = NULL;

			delete pData->pSta2;
			pData->pSta2 = NULL ;

			delete pData;
			pData = NULL;
		}
	}
	ResetContent();
	m_mButton.clear();
}
开发者ID:SoyPay,项目名称:DacrsUI,代码行数:27,代码来源:BetPoolListBox.cpp

示例5: ASSERT_VALID

void COXHistoryCombo::SetContents(LPCTSTR pszContents)
{
	ASSERT_VALID(this);

	CString sContents(pszContents);

	// First remove everuthing from the combo
	ResetContent();

	// Then add all new the items
	LPTSTR pszItem = sContents.GetBuffer(0);
	DWORD nIndex = 0;
	TCHAR * p;
	pszItem =  UTBStr::tcstok(pszItem, ITEM_SEPERATOR, &p);

	// ... Cast to DWORD so that -1 becomes a very large number
	while ((nIndex < (DWORD)m_nMaxHistoryCount) && (pszItem != NULL))
	{
		AddString(pszItem);
		pszItem = UTBStr::tcstok(NULL, ITEM_SEPERATOR, &p);
	}

	sContents.ReleaseBuffer();
	ASSERT_VALID(this);
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:25,代码来源:OXHistoryCombo.cpp

示例6: ASSERT_VALID

//******************************************************************************
void CBCGPRibbonCommandsListBox::FillFromCategory (CBCGPRibbonCategory* pCategory)
{
	ASSERT_VALID (this);

	ResetContent ();

	m_nTextOffset = 0;

	if (pCategory == NULL)
	{
		return;
	}

	ASSERT_VALID (pCategory);

	CArray<CBCGPBaseRibbonElement*, CBCGPBaseRibbonElement*> arElements;
	pCategory->GetElements (arElements);

	FillFromArray (arElements, TRUE, TRUE);

	if (m_pSeparator != NULL)
	{
		ASSERT_VALID (m_pSeparator);
		m_pSeparator->AddToListBox (this, FALSE);
	}
}
开发者ID:iclosure,项目名称:jframework,代码行数:27,代码来源:BCGPRibbonCommandsListBox.cpp

示例7: SetItemHeight

bool CXTPSyntaxEditColorComboBox::Init()
{
	// MFCBUG: adjust height so display is the same as non-owner drawn
	// CComboBoxes. MFC sets the height of an owner-drawn CComboBox
	// 2-3 pixels larger than a non owner-drawn combo.

	SetItemHeight(-1, (::GetSystemMetrics(SM_CYVTHUMB)-::GetSystemMetrics(SM_CYEDGE)));

	ResetContent();

	AddColor( RGB(0x00,0x00,0x00), XTP_IDS_CLR_BLACK ),
	AddColor( RGB(0xff,0xff,0xff), XTP_IDS_CLR_WHITE ),
	AddColor( RGB(0x80,0x00,0x00), XTP_IDS_CLR_MAROON ),
	AddColor( RGB(0x00,0x80,0x00), XTP_IDS_CLR_DARK_GREEN ),
	AddColor( RGB(0x80,0x80,0x00), XTP_IDS_CLR_OLIVE ),
	AddColor( RGB(0x00,0x00,0x80), XTP_IDS_CLR_DARK_BLUE ),
	AddColor( RGB(0x80,0x00,0x80), XTP_IDS_CLR_PURPLE ),
	AddColor( RGB(0x00,0x80,0x80), XTP_IDS_CLR_TEAL ),
	AddColor( RGB(0xC0,0xC0,0xC0), XTP_IDS_CLR_GRAY25 ),
	AddColor( RGB(0x80,0x80,0x80), XTP_IDS_CLR_GRAY50 ),
	AddColor( RGB(0xFF,0x00,0x00), XTP_IDS_CLR_RED ),
	AddColor( RGB(0x00,0xFF,0x00), XTP_IDS_CLR_GREEN ),
	AddColor( RGB(0xFF,0xFF,0x00), XTP_IDS_CLR_YELLOW ),
	AddColor( RGB(0x00,0x00,0xFF), XTP_IDS_CLR_BLUE ),
	AddColor( RGB(0xFF,0x00,0xFF), XTP_IDS_CLR_PINK ),
	AddColor( RGB(0x00,0xFF,0xFF), XTP_IDS_CLR_TURQUOISE ),

	SetCurSel(0);
	return true;
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:30,代码来源:XTPSyntaxEditColorComboBox.cpp

示例8: DoCopy

void CClipboardListBox::OnRButtonUp(UINT nFlags, CPoint point)
{
	const UINT_PTR IDM_SELECTALL = 0x80fb;
	const UINT_PTR IDM_COPY = 0x80fc;
	const UINT_PTR IDM_CLEAR = 0x80fd;
	CMenu menu;
	menu.CreatePopupMenu();
	menu.InsertMenu(0, MF_BYPOSITION|MF_STRING, IDM_SELECTALL, "Select All");
	menu.InsertMenu(1, MF_BYPOSITION|MF_STRING, IDM_COPY, "Copy");
	menu.InsertMenu(2, MF_BYPOSITION|MF_STRING, IDM_CLEAR, "Clear");

	this->ClientToScreen(&point);
	UINT_PTR cmd = menu.TrackPopupMenu(TPM_LEFTALIGN|TPM_TOPALIGN|TPM_RETURNCMD, point.x, point.y, this);

	if(IDM_COPY==cmd)
	{
		DoCopy();
	}
	else if(IDM_CLEAR==cmd)
	{
		ResetContent();
	}	
	else if(IDM_SELECTALL==cmd)
	{
		SelectAll();	
	}	
	return;
	//CListBox::OnRButtonUp(nFlags, point);
}
开发者ID:asion0,项目名称:GNSS_Viewer_V2,代码行数:29,代码来源:ClipboardListBox.cpp

示例9: ResetContent

// removes all the items from the history list, and optionally deletes
// the registry items. Note that if the history list is generated from
// a CRecentFileList, then registry entries will not be deleted
void CHistoryCombo::ClearHistory(BOOL bDeleteRegistryEntries/*=TRUE*/)
{
	ResetContent();
	if (! m_sSection.IsEmpty() && bDeleteRegistryEntries)
	{
		// remove profile entries
		CWinApp* pApp = AfxGetApp();
		ASSERT(pApp);
		CString sKey;

		for (int n = 0; n < 1000/* prevent runaway*/; n++)
		{
			sKey.Format(KEY_PREFIX_FORMAT, m_sKeyPrefix, n);
			CString sText = pApp->GetProfileString(m_sSection, sKey);
			if (sText.IsEmpty())
				break;
			pApp->WriteProfileString(m_sSection, sKey, NULL); // remove entry
		}

		if (! m_sKeyCurItem.IsEmpty())
			sKey = m_sKeyCurItem;
		else if (m_sKeyPrefix.IsEmpty())
			sKey = _T("Last");
		else
			sKey = m_sKeyPrefix;

		pApp->WriteProfileString(m_sSection, sKey, NULL);
	}
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:32,代码来源:XHistoryCombo.cpp

示例10: ResetContent

BOOL CDomainListBox::SetCurrentStocks( int nType, LPCTSTR lpszDomain, CDomainContainer & groups )
{
	// Delete All
	ResetContent( );

	CStockContainer & container = AfxGetStockContainer();
	CStockContainer cntn;

	BOOL	bOK	=	FALSE;
	if( nType == CStockContainer::typeGroup )
	{
		CSPStringArray	astrSpecify;
		if( groups.GetDomainStocks( lpszDomain, astrSpecify ) )
			bOK	=	cntn.RetrieveSpecify( astrSpecify );	//	Not Set dwDate
	}
	else
	{
		bOK	=	cntn.RetrieveFromStatic( nType, lpszDomain, NULL, -1 );
	}

	if( bOK )
	{
		InitStorage( cntn.GetSize(), 32 );
		for( int i=0; i<cntn.GetSize(); i++ )
		{
			CStockInfo & info = cntn.ElementAt(i);
			CString	strItem	=	CString(info.GetStockCode()) + "(" + info.GetStockShortName() + ")    ";
			while( strItem.GetLength() < 16 )	strItem	+=	" ";
			strItem	+= info.GetStockName() ;
			int nItem = AddString( strItem );
		}
	}

	return bOK;
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:35,代码来源:SetGroupDlg.cpp

示例11: diffSet

void CListBoxDiffMarks::setLines(const StringArray &lines) {
  const size_t lastSize = m_lastContent.size();
  const size_t n        = lines.size();

  m_diffSetArray.clear();
  for (size_t i = 0; i < n; i++) {
    const String &line = lines[i];
    const size_t  len  = line.length();
    BitSet diffSet(max(len, 10));
    if(len > 0) {
      if (i >= lastSize) {
        diffSet.add(0,len-1);
      } else {
        const String &lastLine = m_lastContent[i];
        const size_t  lastLen  = lastLine.length();
        const size_t  lmin = min(len, lastLen);
        const TCHAR  *cp = line.cstr(), *lcp = lastLine.cstr();
        size_t        j;
        for (j = 0; j < lmin; j++) {
          if(*(cp++) != *(lcp++)) diffSet.add(j);
        }
        if(j < len) diffSet.add(j, len-1);
      }
    }
    m_diffSetArray.add(diffSet);
  }
  ResetContent();
  for(size_t i = 0; i < lines.size(); i++) {
    AddString(EMPTYSTRING);
  }
  m_lastContent = lines;
}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:32,代码来源:ListBoxDiffMarks.cpp

示例12: GetWindowText

void CPropertyComboBox::updatePropertyDesc(const EdsPropertyDesc* desc)
{
	// The content of the list is deleted.
	// Current settings values are not changed in some cases even if the list changes, so leave the selected text as it is
	CString ss;
	GetWindowText(ss);
	ResetContent();
	SetWindowText(ss);
	
	// It makes it to disable when there is no value list that can be set. 
	EnableWindow( desc->numElements != 0 );


	for(int i = 0; i < desc->numElements; i++)
	{
		// The character string corresponding to data is acquired.
		std::map<EdsUInt32, const char *>::iterator itr = _propertyTable.find((EdsUInt32)desc->propDesc[i]);

		// Create list of combo box
		if (itr != _propertyTable.end())
		{
			// Insert string
			int index = InsertString(-1, itr->second);
			// Set data
			SetItemData(index, itr->first);
		}
	}	
}
开发者ID:mengskysama,项目名称:EDSDK,代码行数:28,代码来源:PropertyComboBox.cpp

示例13: ResetContent

// removes all the items from the history list, and optionally deletes
// the registry items. Note that if the history list is generated from
// a CRecentFileList, then registry entries will not be deleted
void CHistoryCombo::ClearHistory(BOOL bDeleteRegistryEntries/*=TRUE*/)
{
  ResetContent();
  if (! m_sSection.IsEmpty() && bDeleteRegistryEntries)
  {
    // get the actual reg key used
    CWinApp* pApp = AfxGetApp();
    CRegKey rk;
    CString sKey = "SOFTWARE\\";
    if (pApp->m_pszRegistryKey == NULL || pApp->m_pszAppName == NULL)
      return;
    sKey += pApp->m_pszRegistryKey + CString("\\");
    sKey += pApp->m_pszAppName + CString("\\");
    sKey += m_sSection;
    if (rk.Open(HKEY_CURRENT_USER, sKey) != ERROR_SUCCESS)
      return;
    // delete actual values
    int nMax = m_nMaxHistoryItems + 1;
    for (int n = 0; n < nMax; n++)
    {
      sKey.Format("%s%d", m_sKeyPrefix, n);
      rk.DeleteValue(sKey);
    }
    if (!m_sKeyCurItem.IsEmpty())
      sKey = m_sKeyCurItem;
    else if (m_sKeyPrefix.IsEmpty())
      sKey = "Last";
    else
      sKey = m_sKeyPrefix;
    rk.DeleteValue(sKey);
  }
}
开发者ID:hackshields,项目名称:antivirus,代码行数:35,代码来源:HistoryCombo.cpp

示例14: CPWL_IconList_Item

void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM& cp) {
  for (int32_t i = 0; i < m_nListCount; i++) {
    CPWL_IconList_Item* pNewItem = new CPWL_IconList_Item();

    PWL_CREATEPARAM icp = cp;
    icp.pParentWnd = this;
    icp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_NOREFRESHCLIP;
    pNewItem->Create(icp);
  }

  SetItemSpace(PWL_IconList_ITEM_SPACE);
  ResetContent(0);

  if (CPWL_Wnd* pParent = GetParentWindow()) {
    CPDF_Rect rcScroll = GetScrollArea();
    GetScrollPos();

    PWL_SCROLL_INFO sInfo;
    sInfo.fContentMin = rcScroll.bottom;
    sInfo.fContentMax = rcScroll.top;
    sInfo.fPlateWidth = GetClientRect().Height();
    sInfo.fSmallStep = 13.0f;
    sInfo.fBigStep = sInfo.fPlateWidth;

    pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (intptr_t)&sInfo);
  }
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:27,代码来源:PWL_IconList.cpp

示例15: GetCount

//Private
BOOL COXMultiComboBox::ChangeMasterColumn(int /* nCol */)
{
	int nNumItems = GetCount();
	CArray<COXRowData*,COXRowData*> aPtrsRowData; 

	aPtrsRowData.SetSize(nNumItems);
	int nIndex=0;
	for(nIndex=0; nIndex < nNumItems; nIndex++)
	{
		COXRowData* pRowData = GetRowData(nIndex);
		aPtrsRowData[nIndex] = pRowData;
		if (pRowData == NULL)
			TRACE0("In COXMultiComboBox::ChangeMasterColumn : GetRowData() returned NULL.\n");
	}

	// ... To avoid deleting the Rowdata in DeleteItem
	m_fMasterColumnChanging = TRUE; 
	// ... Delete all the Items
	ResetContent();		
	// ... Resets the flag
	m_fMasterColumnChanging = FALSE; 

	int nRetVal;
	//	Again add all the items. This deletion and addition is to effect 
	//	the sorting order based on current master column
	for(nIndex=0; nIndex < nNumItems; nIndex++)
	{
		if((nRetVal = CComboBox::AddString((aPtrsRowData[nIndex])->GetColumnString(m_nMasterColumn))) != CB_ERR)
			SetRowData(nRetVal,aPtrsRowData[nIndex]);
		else 
			return FALSE;
	}

	return TRUE;
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:36,代码来源:OXMultiComboBox.cpp


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