Пример #1
0
// Documented in the base class
int CPSMLReader::GetSummary(char **SummaryPtr)
{
char **SummaryData;

	if (m_NetPDLDecodingEngine)
	{
		// If our source is the Decoding Engine, we can access to some internal structures of the PSMLMaker
		SummaryData= ((CNetPDLDecoder *) m_NetPDLDecodingEngine)->m_PSMLMaker->m_summaryStructData;

		// Convert PSMLMaker internal data to a '\0' delimited ascii buffer
		return FormatItem(SummaryData, SummaryPtr);
	}
	else
	{
		// If our source is a file, we have to list the '<section>' contained in the summary node

		// Convert XML data to a '\0' delimited ascii buffer
		return FormatItem(m_summarySection, (int) strlen(m_summarySection), SummaryPtr);
	}
}
Пример #2
0
// Documented in the base class
int CPSMLReader::GetPacket(unsigned long PacketNumber, char **PacketPtr)
{
unsigned int AsciiBufferLen;
int RetVal;

	RetVal= GetXMLPacketFromDump(PacketNumber, m_asciiBuffer.GetStartBufferPtr(), m_asciiBuffer.GetBufferTotSize(), AsciiBufferLen);
	if ((RetVal == nbWARNING) || (RetVal == nbFAILURE))
		return RetVal;

	// Convert XML data to a '\0' delimited ascii buffer
	return FormatItem(m_asciiBuffer.GetStartBufferPtr(), AsciiBufferLen, PacketPtr);
}
Пример #3
0
void  NU_printf(CHAR *f, ...) /* variable arguments */
{
	CHAR  *argP;

	vaStart(argP, f);       /* point at the end of the format string */
	while (*f)
	{                       /* this works because args are all ints */
		if (*f == '%')
			f = FormatItem(f + 1, vaArg(argP, INT));
		else
			NET_putchar(*f++);
	}
}
Пример #4
0
// Documented in the base class
int CPSMLReader::GetCurrentPacket(char **PacketPtr)
{
char **ItemData;

	if (m_NetPDLDecodingEngine)
	{
		// If our source is the Decoding Engine, we can access to some internal structures of the PSMLMaker
		ItemData= ((CNetPDLDecoder *) m_NetPDLDecodingEngine)->m_PSMLMaker->m_summaryItemsData;

		// Convert PSMLMaker internal data to a '\0' delimited ascii buffer
		return FormatItem(ItemData, PacketPtr);
	}

	errorsnprintf(__FILE__, __FUNCTION__, __LINE__, m_errbuf, sizeof(m_errbuf), "The current PSML item cannot be returned when the PSML source is a file.");
	return nbFAILURE;
}
Пример #5
0
//*************************************************************************************
void CBCGPKeyMapDlg::CopyKeyMap ()
{
	int i = m_KeymapList.GetSelectedCount();
	if (i <= 0)
	{
		MessageBeep ((UINT)-1);
		return;
	}

	CString strText;
	int nItem = -1;
	int nFlag = (m_KeymapList.GetSelectedCount () > 0)  ?  LVNI_SELECTED : LVNI_ALL;

	while ((nItem = m_KeymapList.GetNextItem (nItem, nFlag)) >= 0)
	{
		strText += FormatItem (nItem) + _T("\r\n");
	}

	if (OpenClipboard ())
	{
		EmptyClipboard ();

		HGLOBAL hClipbuffer = ::GlobalAlloc (GMEM_DDESHARE, (strText.GetLength () + 1) * sizeof (TCHAR));
		if (hClipbuffer != NULL)
		{
			LPTSTR lpszBuffer = (LPTSTR) GlobalLock (hClipbuffer);

			lstrcpy (lpszBuffer, (LPCTSTR) strText);

			::GlobalUnlock (hClipbuffer);
			::SetClipboardData (_TCF_TEXT, hClipbuffer);
		}

		CloseClipboard();
	}
}
//*****************************************************************************
BOOL CCxNDArrayDimItem::OnEdit (LPPOINT)
{
	ASSERT_VALID (this);
	ASSERT_VALID (m_pGridRow);

	if (!m_bAllowEdit)
	{
		return FALSE;
	}

	CCxNDArrayDimGrid* pWndList = (CCxNDArrayDimGrid*)((CCxNDArrayDimRow*)m_pGridRow)->m_pWndList;
	ASSERT_VALID (pWndList);

	m_pWndInPlace = NULL;

	OnBeginInplaceEdit ();

	CRect rectEdit;
	CRect rectSpin;

	AdjustInPlaceEditRect (rectEdit, rectSpin);

	BOOL bDefaultFormat = FALSE;
	m_pWndInPlace = CreateInPlaceEdit (rectEdit, bDefaultFormat);

	pWndList->OnAfterInplaceEditCreated (this, m_pWndInPlace);

	if (m_pWndInPlace != NULL)
	{
		//通过隐藏CEdit控件,实现Combo单元格只读效果
		if ( m_nIdColumn == CCxNDArrayDimGrid::COL_DIM_TYPE )
		{
			m_pWndInPlace->ShowWindow(SW_HIDE);
		}

		if (bDefaultFormat)
		{
			m_pWndInPlace->SetWindowText (FormatItem ());
		}

		if (m_dwFlags & BCGP_GRID_ITEM_HAS_LIST)
		{
			CRect rectCombo = m_Rect;
			rectCombo.left = rectEdit.left - 4;

			m_pWndCombo = CreateCombo (pWndList, rectCombo);
			ASSERT_VALID (m_pWndCombo);

			SetComboFont ();

			//-------------------------------------------------------------------
			// Synchronize bottom edge of the combobox with the item bottom edge:
			//-------------------------------------------------------------------
			m_pWndCombo->GetWindowRect (rectCombo);
			pWndList->ScreenToClient (&rectCombo);

			int dy = rectCombo.Height () - m_Rect.Height ();

			m_pWndCombo->SetWindowPos (NULL, rectCombo.left,
				rectCombo.top - dy + 1, -1, -1, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);

			if (m_varValue.vt == VT_BOOL)
			{
				m_lstOptions.AddTail (pWndList->m_strTrue);
				m_lstOptions.AddTail (pWndList->m_strFalse);
			}

			for (POSITION pos = m_lstOptions.GetHeadPosition (); pos != NULL;)
			{
				m_pWndCombo->AddString (m_lstOptions.GetNext (pos));
			}
		}

		if (m_dwFlags & BCGP_GRID_ITEM_HAS_SPIN)
		{
			m_pWndSpin = CreateSpinControl (rectSpin);
		}

		SetInPlaceEditFont ();
		m_pWndInPlace->SetFocus ();

		if ( !m_bAllowEdit )
		{
			m_pWndInPlace->HideCaret ();
		}

		m_bInPlaceEdit = TRUE;
		return TRUE;
	}

	return FALSE;
}