closeable tabs für search funktio

Ich habe es ganz unten intregriert!

beim SearchDlg.cpp

Code:
void CMuteSearchDlg::OnShowWindow(BOOL bShow, UINT nStatus) 
  {
  	CResizableDialog::OnShowWindow(bShow, nStatus);
  
  	SetStrings();
  	m_SearchList.SetStrings();	
  }
  
  
  void CMuteSearchDlg::SetSearchResultsIcon(UINT uSearchID, int iImage)
  {
  	int iTabItems = searchselect.GetItemCount();
  	for (int i = 0; i < iTabItems; i++)
  	{
  		TCITEM tci;
  		tci.mask = TCIF_PARAM;

  		/*
 		if (searchselect.GetItem(i, &tci) && tci.lParam != NULL && ((const SSearchParams*)tci.lParam)->dwSearchID == uSearchID)
  		{
  			tci.mask = TCIF_IMAGE;
  			tci.iImage = iImage;
  			searchselect.SetItem(i, &tci);
  			break;
  		}
  	*/
  	}
  }
  
  
  /*
  SSearchParams* CMuteSearchDlg::GetSearchResultsParams(UINT uSearchID) const
  {
  	int iTabItems = searchselect.GetItemCount();
  	for (int i = 0; i < iTabItems; i++)
  	{
  		TCITEM tci;
  		tci.mask = TCIF_PARAM;
 		if (searchselect.GetItem(i, &tci) && tci.lParam != NULL && ((const SSearchParams*)tci.lParam)->dwSearchID == uSearchID)
  			return (SSearchParams*)tci.lParam;
  	}
  	return NULL;
  }
  
  void CMuteSearchDlg::OnBnClickedClearall()
  {
  }
  LRESULT CMuteSearchDlg::OnCloseTab(WPARAM wParam, LPARAM lParam)
  {
  	return 0;
  }
  LRESULT CMuteSearchDlg::OnDblClickTab(WPARAM wParam, LPARAM lParam)
  {
  	return 0;
  }
  void CMuteSearchDlg::OnTcnSelchangeTab1(NMHDR *pNMHDR, LRESULT *pResult)
  {
  }
 
Komisch, bei mir funktioniert es problemlos. Ich hab mal meine Version angehängt.

Mfg

langer
 

Anhänge

  • MuteSearchDlg.zip
    8,3 KB · Aufrufe: 19
Hab's bei mir gerade nochmal ausprobiert, läuft ohne Probleme. Wobei ich nur den Programmstart meine. Keine Linkerfehler. Irgendwelche Buttons hab ich nicht ausprobiert...

langer
 
Ach ja, sehe gerade, du hast den Code hinter dem Kommentarzeichen /* eingefügt, das */ fehlt davor. Dann kanns natürlich nicht klappen, weil er mit auskommentiert ist.

langer
 
ich weis nicht habe es gedownloadet und die datei ersetzt mit der von dir

es Kommt der gleiche Fehler!

Code:
MFC_MUTE_GUI fatal error LNK1120: 4 unaufgelöste externe Verweise
 MFC_MUTE_GUI error LNK2001: Nichtaufgelöstes externes Symbol "protected: long __thiscall CMuteSearchDlg::OnCloseTab(unsigned int,long)" (?OnCloseTab@CMuteSearchDlg@@IAEJIJ@Z)
 MFC_MUTE_GUI error LNK2001: Nichtaufgelöstes externes Symbol "protected: long __thiscall CMuteSearchDlg::OnDblClickTab(unsigned int,long)" (?OnDblClickTab@CMuteSearchDlg@@IAEJIJ@Z)
 MFC_MUTE_GUI error LNK2001: Nichtaufgelöstes externes Symbol "protected: void __thiscall CMuteSearchDlg::OnBnClickedClearall(void)" (?OnBnClickedClearall@CMuteSearchDlg@@IAEXXZ)
 MFC_MUTE_GUI error LNK2001: Nichtaufgelöstes externes Symbol "protected: void __thiscall CMuteSearchDlg::OnTcnSelchangeTab1(struct tagNMHDR *,long *)" (?OnTcnSelchangeTab1@CMuteSearchDlg@@IAEXPAUtagNMHDR@@PAJ@Z)
 
kann es eihn da sich diese tabs funktion hier ienbauen muss?

Code:
//*******************************************************************
 //  FUNCTION:   -	OnSearchButton()
 //  RETURNS:	-	
 //  PARAMETERS: -	
 //  COMMENTS:	-	
 //*******************************************************************
 void CMuteSearchDlg::OnSearchButton() 
 {
 	int				i;
 	SearchThread	*pSearchThread;
 	CString			strTemp;
 
 	UpdateData(TRUE);
 
 	m_strSearchEdit.TrimLeft();
 	m_strSearchEdit.TrimRight();
 	m_strSearchEdit.MakeLower();
 	m_strSearchExcludeEdit.TrimLeft();
 	m_strSearchExcludeEdit.TrimRight();
 	m_strSearchExcludeEdit.MakeLower();
 	m_strFileSizeEdit.TrimLeft();
 	m_strFileSizeEdit.TrimRight();	
 
 	if( m_strSearchEdit.IsEmpty() )
 	{
 		// don't do any searching if the search field is empty!
 		return;
 	}
 	m_oSearchParser.vGo( (LPCSTR)m_strSearchEdit, ' ', FALSE );
 	m_oSearchExcludeParser.vGo( (LPCSTR)m_strSearchExcludeEdit, ' ', FALSE );
 					
 	// delete old results, if there are any
 	mResultLock->lock();
 
 	m_SearchList.DeleteAllItems();
 	m_SearchList.ResetCaches();
 	m_SearchList.Invalidate();
 	m_vecSearchItems.resize(0);
 	m_vecSearchItems.reserve(100000); // without this, the list will crash on sorting
 
 
 	int numResults = mResultsFromAddresses->size();
 	for( i = 0; i < numResults; i++ ) 
 	{
 		delete [] *( mResultsFromAddresses->getElement( i ) );
 		delete [] *( mResultsFilePaths->getElement( i ) );
 		delete [] *( mResultsFileHashes->getElement( i ) );
 	}
 
 	mResultsFromAddresses->deleteAll();
 	mResultsFilePaths->deleteAll();
 	mResultsFileHashes->deleteAll();
 	mResultsFileSizes->deleteAll();
 	
 	mResultLock->unlock();
 
 	// spawn thread for search
 	mSearchLock->lock();
 	mSearchCanceled = false;
 	mSearchActive = true;
 	for( i = 0; i < (int) m_vecSearchThread.size(); i++ )
 	{
 		if( NULL != m_vecSearchThread[i] )
 		{
 			delete m_vecSearchThread[i];
 		}
 	}
 	m_vecSearchThread.resize(0);
 	
 	// need to have a search for each separate word in the search 
 	// edit box
 	if( SEARCH_BOOLEAN_ENTIRE_PHRASE == m_nSearchBoolean )
 	{
 		pSearchThread = new SearchThread( (LPCSTR) m_strSearchEdit, (void *)this );
 		m_vecSearchThread.push_back( pSearchThread );
 	}
 	else
 	{
 		for( i = 0; i < m_oSearchParser.nGetNumFields(); i++ )
 		{
 			pSearchThread = new SearchThread( m_oSearchParser.m_strOutput[i].c_str(), (void *)this );
 			m_vecSearchThread.push_back( pSearchThread );
 		}
 	}
 
 	mSearchLock->unlock();
 		
 
 	GetDlgItem(IDC_SEARCH_BUTTON)->EnableWindow( FALSE );
 	GetDlgItem(IDC_CLEAR_SEARCH_RESULTS_BUTTON)->EnableWindow( FALSE );
 	GetDlgItem(IDC_DOWNLOAD_BUTTON)->EnableWindow(FALSE);
 	GetDlgItem(IDC_STOP_BUTTON)->EnableWindow( TRUE );	
 	m_oSearchingLED.SetLed( CLed::LED_COLOR_GREEN, CLed::LED_OFF, CLed::LED_ROUND );
 	strTemp = m_ExtStr.LoadString( IDS_SEARCH_SEARCHING_STATUS_ENG + g_unStringLanguageIdOffset );
 	m_staticSearchingText.SetWindowText( strTemp );
 	GetDlgItem(IDC_SEARCH_STRING_EDIT)->EnableWindow( FALSE );
 	GetDlgItem(IDC_COMBO_AND_OR)->EnableWindow( FALSE );	
 	GetDlgItem(IDC_FILESIZE_EDIT)->EnableWindow( FALSE );
 	GetDlgItem(IDC_COMBO_FILESIZE)->EnableWindow( FALSE );
 	GetDlgItem(IDC_SEARCH_STRING_EXCLUDE_EDIT)->EnableWindow( FALSE );
 	GetDlgItem(IDC_EXPORT_SEARCH_RESULTS_BUTTON)->EnableWindow(FALSE);
 	
 	// make sure the ALT-XXX keys work for the appropriate buttons
 	GetDlgItem(IDC_STOP_BUTTON)->SetFocus();
 }

unter MuteSearchListCtrl.cpp

gibts noch das hier:
Code:
 //**************************************************************************************
 //  FUNCTION:	-	SearchDownloadClick()
 //  RETURNS:	-	
 //  PARAMETERS:	-	
 //  COMMENTS:		If a right click menu is popped up over an item and the user clicks
 //		    		the download item, this is called for the list.
 //**************************************************************************************
 */
 void CMuteSearchListCtrl::SearchDownloadClick(  WPARAM wParam, LPARAM lParam )
 {
 	if( !m_semListOperations.Lock(1500) )
 	{
 		return;
 	}
 
 	if (GetSelectionMark() != (-1))
 	{
 		m_semListOperations.Unlock();
 		((CMuteSearchDlg *)GetParent())->OnDownloadButton();	
 	}
 	else
 	{
 		m_semListOperations.Unlock();
 	}
 }
 
 /*
 

Neue Beiträge

Zurück