Ejemplo n.º 1
0
/*
 * Move the cursor to the first column of the n-th previous line.
 */
void
CursorPrevLine(TScreen *screen, int count)
{
	CursorUp(screen, count < 1 ? 1 : count);
	CarriageReturn(screen);
	do_xevents();
}
Ejemplo n.º 2
0
void CHTMLSectionCreator::SkipLeftMargin()
{
	int nNewYPos = GetCurrentYPos();
	//
	//	Only do this if there is a right margin!
	if( m_stkLeftMargin.GetSize() )
	{
		CarriageReturn( true );
		nNewYPos = GetCurrentYPos();

		m_nLeftMargin = m_nDefaultLeftMargin;

		while( m_stkLeftMargin.GetSize() )
		{
			MarginStackItem msi = m_stkLeftMargin.Pop();
			if( msi.nYExpiry > nNewYPos )
			{	
				nNewYPos = msi.nYExpiry;
			}
		}
	}

	SetCurrentXPos( GetLeftMargin() );
	SetCurrentYPos( nNewYPos );
}
Ejemplo n.º 3
0
void CHTMLSectionCreator::Finished()
//
//	Signals the end fo the document.
{
	CarriageReturn( true );

	//
	//	Adjust the height of our document to take into account any images or tables there may be on the left or right
	//	of the document and that may be taller than we have left the document
	while( m_stkRightMargin.GetSize() )
	{
		MarginStackItem msi = m_stkRightMargin.Top();
		if( msi.nYExpiry > m_nYPos )
			m_nYPos = msi.nYExpiry;
		(void)m_stkRightMargin.Pop();
	}

	while( m_stkLeftMargin.GetSize() )
	{
		MarginStackItem msi = m_stkLeftMargin.Top();
		if( msi.nYExpiry > m_nYPos )
			m_nYPos = msi.nYExpiry;
		(void)m_stkLeftMargin.Pop();
	}
	if( m_dc.IsPrinting() )
		GetHTMLSection()->AddBreakSection(GetCurrentShapeID());
}
Ejemplo n.º 4
0
/*
 * Move the cursor to the first column of the n-th next line.
 */
void
CursorNextLine(TScreen *screen, int count)
{
	CursorDown(screen, count < 1 ? 1 : count);
	CarriageReturn(screen);
	do_xevents();
}
Ejemplo n.º 5
0
/*
 * Move the cursor to the first column of the n-th previous line.
 */
void
CursorPrevLine(XtermWidget xw, int count)
{
    TScreen *screen = TScreenOf(xw);

    CursorUp(screen, count < 1 ? 1 : count);
    CarriageReturn(xw);
    do_xevents();
}
Ejemplo n.º 6
0
//按钮7:双向打印参数
void CSysArgMenu::OnButton7(int iEvent, unsigned char * pEventData, int iDataLen)
{
	string strErr = "是否放入白纸打印?";
	if(YesNoMsBox(strErr)==SUCCESS)
	{
		if (isPaper() != 0)
		{ 
			CaMsgBox::ShowMsg("打印机未检测到纸");
			return;
		}
#if (POS_TYPE != POS_APE4000RG)		
		char chValue[256];
		
		UINT8 i =0;
		for(i=0;i<10;i++)
		{
			memset(chValue, 0, sizeof(chValue));
			DBG_PRINT(("i=%u", i));
			
			PrinterIni(i);
			sprintf(chValue, "双向打印参数打印:航天信息蜂鸣器正常异常状态 参数%u",i);
			//PrintStr(chValue);
			
			//PrintChineseLine(chValue, strlen(chValue));
			PrintAsciiLine(chValue, strlen(chValue));
			
			SetLineSpace(0);
			sprintf(chValue, "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH");
			//PrintChineseLine(chValue, strlen(chValue));
			PrintAsciiLine(chValue, strlen(chValue));
			sprintf(chValue, "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH");
			//PrintChineseLine(chValue, strlen(chValue));
			PrintAsciiLine(chValue, strlen(chValue));

			CarriageReturn();
		}	
		ForwardNLine(FORWARD_LINES);
#else
		BidirectionalParaTest();
		ForwardNLine(FORWARD_LINES);
#endif
	}
	
	m_EditSysArgID = SYS_BIDIRECTION_PRINT;
	m_pSysArgEditWin->ReFresh();
	ChangeWin(SYS_ARG_EDIT_WIN);
}
Ejemplo n.º 7
0
void CHTMLSectionCreator::NewParagraph( int nSpaceAbove, int nSpaceBelow, CStyle::Align alg )
//
//	New paragraph.
//	Add on the space below from the previous paragraph and the space above for this paragraph.
{
	CarriageReturn( true );

	if( m_nYPos != m_nTop )
	{
		const int nCurrentFontHeight = m_dc.GetCurrentFontHeight();
		m_nYPos += ( nCurrentFontHeight * m_nPreviousParaSpaceBelow ) / 2;
		m_nYPos += ( nCurrentFontHeight * nSpaceAbove ) / 2;
	}

	if( alg != CStyle::algEmpty )
		m_algCurrentPargraph = alg;

	m_nPreviousParaSpaceBelow = nSpaceBelow;
}
Ejemplo n.º 8
0
void CScreenDevice::NewLine (void)
{
	CarriageReturn ();
	CursorDown ();
}
Ejemplo n.º 9
0
void CScreenDevice::Write (char chChar)
{
	switch (m_nState)
	{
	case ScreenStateStart:
		switch (chChar)
		{
		case '\b':
			CursorLeft ();
			break;

		case '\t':
			Tabulator ();
			break;

		case '\n':
			NewLine ();
			break;

		case '\r':
			CarriageReturn ();
			break;

		case '\x1b':
			m_nState = ScreenStateEscape;
			break;

		default:
			DisplayChar (chChar);
			break;
		}
		break;

	case ScreenStateEscape:
		switch (chChar)
		{
		case 'M':
			ReverseScroll ();
			m_nState = ScreenStateStart;
			break;

		case '[':
			m_nState = ScreenStateBracket;
			break;

		default:
			m_nState = ScreenStateStart;
			break;
		}
		break;

	case ScreenStateBracket:
		switch (chChar)
		{
		case '?':
			m_nState = ScreenStateQuestionMark;
			break;

		case 'A':
			CursorUp ();
			m_nState = ScreenStateStart;
			break;

		case 'B':
			CursorDown ();
			m_nState = ScreenStateStart;
			break;

		case 'C':
			CursorRight ();
			m_nState = ScreenStateStart;
			break;

		case 'H':
			CursorHome ();
			m_nState = ScreenStateStart;
			break;

		case 'J':
			ClearDisplayEnd ();
			m_nState = ScreenStateStart;
			break;

		case 'K':
			ClearLineEnd ();
			m_nState = ScreenStateStart;
			break;

		case 'L':
			InsertLines (1);
			m_nState = ScreenStateStart;
			break;

		case 'M':
			DeleteLines (1);
			m_nState = ScreenStateStart;
			break;

		case 'P':
			DeleteChars (1);
			m_nState = ScreenStateStart;
			break;

		default:
			if ('0' <= chChar && chChar <= '9')
			{
				m_nParam1 = chChar - '0';
				m_nState = ScreenStateNumber1;
			}
			else
			{
				m_nState = ScreenStateStart;
			}
			break;
		}
		break;

	case ScreenStateNumber1:
		switch (chChar)
		{
		case ';':
			m_nState = ScreenStateSemicolon;
			break;

		case 'L':
			InsertLines (m_nParam1);
			m_nState = ScreenStateStart;
			break;

		case 'M':
			DeleteLines (m_nParam1);
			m_nState = ScreenStateStart;
			break;

		case 'P':
			DeleteChars (m_nParam1);
			m_nState = ScreenStateStart;
			break;

		case 'X':
			EraseChars (m_nParam1);
			m_nState = ScreenStateStart;
			break;

		case 'h':
		case 'l':
			if (m_nParam1 == 4)
			{
				InsertMode (chChar == 'h');
			}
			m_nState = ScreenStateStart;
			break;
			
		case 'm':
			SetStandoutMode (m_nParam1);
			m_nState = ScreenStateStart;
			break;

		default:
			if ('0' <= chChar && chChar <= '9')
			{
				m_nParam1 *= 10;
				m_nParam1 += chChar - '0';

				if (m_nParam1 > 99)
				{
					m_nState = ScreenStateStart;
				}
			}
			else
			{
				m_nState = ScreenStateStart;
			}
			break;
		}
		break;

	case ScreenStateSemicolon:
		if ('0' <= chChar && chChar <= '9')
		{
			m_nParam2 = chChar - '0';
			m_nState = ScreenStateNumber2;
		}
		else
		{
			m_nState = ScreenStateStart;
		}
		break;

	case ScreenStateQuestionMark:
		if ('0' <= chChar && chChar <= '9')
		{
			m_nParam1 = chChar - '0';
			m_nState = ScreenStateNumber3;
		}
		else
		{
			m_nState = ScreenStateStart;
		}
		break;

	case ScreenStateNumber2:
		switch (chChar)
		{
		case 'H':
			CursorMove (m_nParam1, m_nParam2);
			m_nState = ScreenStateStart;
			break;

		case 'r':
			SetScrollRegion (m_nParam1, m_nParam2);
			m_nState = ScreenStateStart;
			break;

		default:
			if ('0' <= chChar && chChar <= '9')
			{
				m_nParam2 *= 10;
				m_nParam2 += chChar - '0';

				if (m_nParam2 > 199)
				{
					m_nState = ScreenStateStart;
				}
			}
			else
			{
				m_nState = ScreenStateStart;
			}
			break;
		}
		break;

	case ScreenStateNumber3:
		switch (chChar)
		{
		case 'h':
		case 'l':
			if (m_nParam1 == 25)
			{
				SetCursorMode (chChar == 'h');
			}
			m_nState = ScreenStateStart;
			break;

		default:
			if ('0' <= chChar && chChar <= '9')
			{
				m_nParam1 *= 10;
				m_nParam1 += chChar - '0';

				if (m_nParam1 > 99)
				{
					m_nState = ScreenStateStart;
				}
			}
			else
			{
				m_nState = ScreenStateStart;
			}
			break;
		}
		break;

	default:
		m_nState = ScreenStateStart;
		break;
	}
}
Ejemplo n.º 10
0
void CSelfTestMenu::OnButton6(int iEvent, unsigned char * pEventData, int iDataLen)
{
//	string strErr = "是否调整打印参数?";
	string strErr = "是否放入白纸打印?";	
	if(YesNoMsBox(strErr)==FAILURE)
	{
		this->ReFresh();
		return;
	}

	if (isPaper() != 0)
	{ 
		CaMsgBox::ShowMsg("打印机未检测到纸");
		return;
	}
#if (POS_TYPE != POS_APE4000RG)
	char chValue[256];
	
	UINT8 i =0;
	for(i=0;i<10;i++)
	{
		memset(chValue, 0, sizeof(chValue));

		//bidirection = i;
		DBG_PRINT(("i=%u", i));
		DBG_PRINT(("bidirection=%u", bidirection));

		PrinterIni(i);	
		
//		sprintf(chValue, "双向打印参数打印:航天信息蜂鸣器正常异常状态 参数%uHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH",i);
		sprintf(chValue, "双向打印参数打印:航天信息蜂鸣器正常异常状态 参数%u",i);
		
		//PrintChineseLine(chValue, strlen(chValue));
		PrintAsciiLine(chValue, strlen(chValue));
		SetLineSpace(0);
		sprintf(chValue, "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH");
		//PrintChineseLine(chValue, strlen(chValue));
		PrintAsciiLine(chValue, strlen(chValue));
		sprintf(chValue, "HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH");
		//PrintStr(chValue);
		//PrintChineseLine(chValue, strlen(chValue));
	    PrintAsciiLine(chValue, strlen(chValue));
		CarriageReturn();
	}

	ForwardNLine(FORWARD_LINES);
	PrinterIni(bidirection);
#else
	BidirectionalParaTest();//双向打印参数检测功能并不改变当前设置的双向打印参数,无需再次设置
	ForwardNLine(FORWARD_LINES);
#endif

	m_pSysArgEditWin = (CSysArgEditWin *)(m_pFrame->GetWin(SYS_ARG_EDIT_WIN));

	((CSysArgMenu *)m_pFrame->GetWin(SYSTEM_ARG_MENU))->m_EditSysArgID = SYS_BIDIRECTION_PRINT;

//	m_pSysArgEditWin = (CSysArgEditWin *)(m_pFrame->GetWin(SYS_ARG_EDIT_WIN));

	
	m_pSysArgEditWin->ReFresh();
	ChangeWin(SYS_ARG_EDIT_WIN);


//	this->ReFresh();
}