Example #1
0
/** @brief User pressed Text button. */
void CTestFilterDlg::OnTestBtn() 
{
	CString text;
	GetDlgItemText(IDC_TEST_TEXT, text);

	BOOL passed = CheckText(text);

	CString result = (passed ? _T("passed") : _T("failed"));
	text += _T(": ") + result;

	AppendResult(text);
}
Example #2
0
DLLEXPORT_TEST_FUNCTION void PdfTextWriter_WriteText(struct PdfTextWriter *self, char *text)
{
	struct StringObject *sText; 
	char *cText;

	cText = CheckText(text);
	sText = StringObject_Create(self->streamWriter, cText);
	StringObject_Write(sText);
	StringObject_Destroy(sText);

	self->streamWriter->WriteData(self->streamWriter, "Tj");	
	self->streamWriter->WriteNewLine(self->streamWriter);	
}
Example #3
0
BOOL DText::Attach(STRCPTR data, TEXT_FORMAT fmt, UINT width /* = 0U */, BOOL warp /* = FALSE */)
{
	if (m_Data)
		return FALSE;

	if (!CheckText(data, fmt, width, warp))
		return FALSE;

	m_Attach = TRUE;
	m_Warp = warp;
	m_Width = width;
	m_Format = fmt;
	m_Data = data;
	m_Length = DStrLen(m_Data);
	return TRUE;
}
Example #4
0
void DevideScript(char *pszScript)
{
	char *pszText = pszScript;
	char *pszPaser;
	int  nLineLen = 0;

	while (*pszText)
	{
		if (pszPaser = CheckText(pszText))
		{
			nLineLen = pszPaser - pszText;

			switch (*pszPaser)
			{
				case '\\':
				{
					if (nLineLen >= 1)
						AddScriptLine(pszText, nLineLen, SCRIPT_GENTEXT);

					AddScriptLine(NULL, 0, SCRIPT_RETURN);
					
					pszText = ++pszPaser;

					break;
				}
				case '<':
				{
					if (nLineLen >= 1)
						AddScriptLine(pszText, nLineLen, SCRIPT_GENTEXT);

					pszText = AddScriptLine(pszPaser, nLineLen, SCRIPT_BUTTON);

					break;
				}
				case '{':
				{
					if (nLineLen >= 1)
						AddScriptLine(pszText, nLineLen, SCRIPT_GENTEXT);

					pszText = AddScriptLine(pszPaser, nLineLen, SCRIPT_TAG);

					break;
				}
			}
		}
	}
}
Example #5
0
BOOL DText::Create(STRCPTR data, TEXT_FORMAT fmt, UINT width /* = 0U */, BOOL warp /* = FALSE */, BOOL pre_alloc /* = FALSE */)
{
	if (m_Data)
		return FALSE;

	if (!CheckText(data, fmt, width, warp))
		return FALSE;

	if (pre_alloc) {
		m_Data = data;
	} else {
		m_Data = AllocData(data);
		if (!m_Data)
			return FALSE;
	}

	m_Attach = FALSE;
	m_Warp = warp;
	m_Width = width;
	m_Format = fmt;
	m_Length = DStrLen(m_Data);
	return TRUE;
}
Example #6
0
HandlerTestProperties::HandlerTestProperties(const char* const szTestName) :
	VSL::UnitTestBase(szTestName)
{
	// Create a CommandId for this command handler.
	VSL::CommandId testId(guidTest1, dwTestId1);

	// Check the default values.
	{   // Create the command handler via first constructor
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId);
		CheckDefaultValues(handler, testId);
	}
	{   // Create the command handler via second constructor
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId.GetGuid(), testId.GetId());
		CheckDefaultValues(handler, testId);
	}

	// Check the status properties when set from the constructor
	{   
		// Create the command handler with only the supported flag set.
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId, NULL, NULL, OLECMDF_SUPPORTED);
		CheckSupportedWasSet(handler, testId);
	}
	{   
		// Create the command handler with only the supported flag set.
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId.GetGuid(), testId.GetId(), NULL, NULL, OLECMDF_SUPPORTED);
		CheckSupportedWasSet(handler, testId);
	}
	DWORD dwVariousFlags = OLECMDF_ENABLED | OLECMDF_INVISIBLE | OLECMDF_LATCHED;
	{   
		// Create the command handler.
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId, NULL, NULL, dwVariousFlags);
		CheckVariousFlagsSet(handler, testId, dwVariousFlags);
	}
	{   
		// Create the command handler.
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId.GetGuid(), testId.GetId(), NULL, NULL, dwVariousFlags);
		CheckVariousFlagsSet(handler, testId, dwVariousFlags);
	}

	// Check that the properties are set correctly by the setter methods.
	{
		// Create a command handler with the default settings.
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId);
		CheckSetters(handler);
	}
	{
		// Create a command handler with the default settings.
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId.GetGuid(), testId.GetId());
		CheckSetters(handler);
	}

	// Check that the Text property is set correctly by the constructor and setter method.
	const wchar_t szText[] = L"Original Text";
	{
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId, NULL, NULL, OLECMDF_ENABLED | OLECMDF_SUPPORTED, szText);
		CheckText(handler, szText);
	}
	{
		VSL::CommandHandlerBase<HandlerTestProperties> handler(testId.GetGuid(), testId.GetId(), NULL, NULL, OLECMDF_ENABLED | OLECMDF_SUPPORTED, szText);
		CheckText(handler, szText);
	}
}
Example #7
0
/*メイン関数*/
void TextClass::Main(UserClass &User){
	//メニューパラメータセット
	static struct MenuArg_rec MenuRightParam;
	SetMenuParam_GameRight(MenuRightParam);
	static MenuClass GameRightMenu(MenuRightParam);

	//定数
	const int OtherSelect = 6;


	//ゲームカウントの初期化
	InitGameCount(User);

	//テキストチェック
	CheckText(User);	

	//制御コードチェック
	if( WriteMode != EYECATCH ) CheckCotrolCode(User);

	//背景描画
	Graph.DrawBack(User);

	//キャラクタ描画
	Graph.DrawChar(User);

	//テキストボックス描画
	if( WriteMode != NOTWINDOW ) Graph.DrawWindow();

	//描画モード取得
	//WriteMode = GetWriteMode();

	//コンフィグで未読スキップ許可設定
	ReadUpdate(User);

	//既読チェック
	CheckRead();
	
	//デバッグ用既読操作
	ControlRead();

	//メニュー設置・処理
	if( WriteMode == NORMAL ){
		GameRightMenu.Create();
		Select = GameRightMenu.GetSelectNo();
	}
	
	//テキスト描画
	if( WriteMode == NORMAL    ) NormalWrite(User);	//通常テキスト描画
	if( WriteMode == EYECATCH  ) EyeCatching(User);	//アイキャッチ
	if( WriteMode == BACKLOG   ) BackLogMain(User);	//バックログ
	if( WriteMode == NOTWINDOW ) NotWindow();		//ウィンドウ非表示
	if( WriteMode == END	   ) GameEnd(User);		//ゲーム終了

	//メニューを選択していなければ、テキストを進める・スキップ・オート
	if( Select == OtherSelect && WriteMode == NORMAL){
		PutNextLine(User);
		//SkipFunction(User);
		AutoFunction(User);
	}
	
	//現在のカウントをセット
	SetGameData(User);
}