Click here to Skip to main content
15,896,322 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 0:52
Eugen Podsypalnikov21-Apr-10 0:52 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 0:54
arun_pk21-Apr-10 0:54 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 1:06
Eugen Podsypalnikov21-Apr-10 1:06 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 1:10
arun_pk21-Apr-10 1:10 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 1:12
Eugen Podsypalnikov21-Apr-10 1:12 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 18:31
arun_pk21-Apr-10 18:31 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 19:15
Eugen Podsypalnikov21-Apr-10 19:15 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 19:18
arun_pk21-Apr-10 19:18 
for (int i = 0; i < Nnots; i++)
	{
		if (!(*m_NotHeader)[i]->Time)
		{
			continue;
		}

		char szEpoch[20] = {0};
		char szTime[20] = {0};

		char szEvent[NOT_STRING_LENGTH] = {0};
		long	sec_on_this_day = (*m_NotHeader)[i]->Time % 86400;
		int	tm_hour = sec_on_this_day / 3600;
		int	tm_min = (sec_on_this_day / 60) % 60;
		int	tm_sec = sec_on_this_day % 60;

		//[fix355] add feature: include epoch number in Notations list
		LONG lEpoch = (*m_NotHeader)[i]->Time;
		::SendMessage(m_hReviewWnd, TWM_WEEG_MESSAGE, TWGM_WEEG_GETEPOCHFORTIME, (LPARAM) &lEpoch);

		wsprintf(szEpoch, "%ld", lEpoch);
		wsprintf(szTime, "%02d:%02d:%02d.%02d", tm_hour, tm_min, tm_sec, ((*m_NotHeader)[i]->Fractional * 100 / nfh.Fraction_Second_Reference));

		//	Don't try to parenthesize string if RT notation:
		int	flagsToUse = flags;
		if (m_dwStaticEndTime)
		{
			SampleID NT = { (*m_NotHeader)[i]->Time, (*m_NotHeader)[i]->Fractional };
			if (NT >= ST || m_dwStaticEndTime == MAXDWORD)
			{	//	it will be max in monitor mode.
				flagsToUse ^= NSI_MARK_IF_NOT_IN_FILES;
			}
		}

		szEvent[0] = '\0';
		NotationString(m_hNotation, (*m_NotHeader)[i], szEvent, sizeof(szEvent), flagsToUse);
		int nItemCount = ListView_GetItemCount(hLVWnd);
		LVITEM lvi;
		lvi.mask = LVIF_TEXT;
		lvi.iItem = nItemCount;
		lvi.iSubItem = 0;
		lvi.pszText = szEpoch;
		listItemIndex = ListView_InsertItem(hLVWnd, &lvi);
		NotationList.nEpoch = atoi(szEpoch); 
		if (listItemIndex != LV_ERR)
		{
			ListView_SetItemText(hLVWnd, nItemCount, 1, szTime);
			strcpy(NotationList.szDateTime,szTime);  
			ListView_SetItemText(hLVWnd, nItemCount, 2, szEvent);
			strcpy(NotationList.szEvent,szEvent); 
			// add the pointer to the notation to the item data. Later we can use this to identify which item is
			// selected. We need to do this because the list must be sorted. AAD 3/29/03
			assert((*m_NotHeader)[i]);
			lvi.mask = LVIF_PARAM;
			lvi.lParam = (LPARAM)(*m_NotHeader)[i];
			ListView_SetItem(hLVWnd, &lvi);
			ListView_SetTextColor(hLVWnd,NewColor);
		}
		NotationInfo->Add(NotationList); 
	}

GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 19:43
Eugen Podsypalnikov21-Apr-10 19:43 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 19:55
arun_pk21-Apr-10 19:55 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 20:07
Eugen Podsypalnikov21-Apr-10 20:07 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 20:18
arun_pk21-Apr-10 20:18 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 20:30
Eugen Podsypalnikov21-Apr-10 20:30 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 20:45
arun_pk21-Apr-10 20:45 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 20:49
Eugen Podsypalnikov21-Apr-10 20:49 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 20:51
arun_pk21-Apr-10 20:51 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 20:57
Eugen Podsypalnikov21-Apr-10 20:57 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 21:01
arun_pk21-Apr-10 21:01 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 20:55
arun_pk21-Apr-10 20:55 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 21:04
Eugen Podsypalnikov21-Apr-10 21:04 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 21:09
arun_pk21-Apr-10 21:09 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 21:18
Eugen Podsypalnikov21-Apr-10 21:18 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 22:45
arun_pk21-Apr-10 22:45 
GeneralRe: Listview Sorting Pin
Eugen Podsypalnikov21-Apr-10 22:46
Eugen Podsypalnikov21-Apr-10 22:46 
GeneralRe: Listview Sorting Pin
arun_pk21-Apr-10 23:03
arun_pk21-Apr-10 23:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.