当前位置: 首页>>代码示例>>C++>>正文


C++ TextEntry::GetText方法代码示例

本文整理汇总了C++中TextEntry::GetText方法的典型用法代码示例。如果您正苦于以下问题:C++ TextEntry::GetText方法的具体用法?C++ TextEntry::GetText怎么用?C++ TextEntry::GetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextEntry的用法示例。


在下文中一共展示了TextEntry::GetText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnCommand

	virtual void OnCommand( const char *command )
	{
		if ( !Q_strnicmp( command, "register", 8 ) )
		{
			if ( steamapicontext && steamapicontext->SteamFriends() )
			{
				steamapicontext->SteamFriends()->ActivateGameOverlayToWebPage( "http://www.youtube.com/create_account?next=/" );
			}
		}		
		else if ( !Q_strnicmp( command, "confirm", 7 ) )
		{
			TextEntry *pTextEntryUserName = dynamic_cast< TextEntry * >( FindChildByName( "UserNameTextEntry" ) );
			TextEntry *pTextEntryPassword = dynamic_cast< TextEntry * >( FindChildByName( "PasswordTextEntry" ) );
			if ( pTextEntryUserName && pTextEntryPassword )
			{
				char szUserName[256];
				pTextEntryUserName->GetText( szUserName, sizeof( szUserName ) );
				char szPassword[256];
				pTextEntryPassword->GetText( szPassword, sizeof( szPassword ) );
				youtube_username.SetValue( szUserName );
				Login( szUserName, szPassword );
			}

			return;
		}
		BaseClass::OnCommand( command );
	}
开发者ID:hekar,项目名称:luminousforts-2013,代码行数:27,代码来源:replayyoutubeapi.cpp

示例2: l_attr_text

	static int l_attr_text(lua_State *l)
	{
		TextEntry *te = LuaObject<UI::TextEntry>::CheckFromLua(1);
		const std::string &text(te->GetText());
		lua_pushlstring(l, text.c_str(), text.size());
		return 1;
	}
开发者ID:MeteoricGames,项目名称:pioneer,代码行数:7,代码来源:LuaTextEntry.cpp

示例3: GatherCurrentValues

//-----------------------------------------------------------------------------
// Purpose: applies all the values in the page
//-----------------------------------------------------------------------------
void CCreateMultiplayerGameGameplayPage::GatherCurrentValues()
{
	if ( !m_pDescription )
		return;

	// OK
	CheckButton *pBox;
	TextEntry *pEdit;
	ComboBox *pCombo;

	mpcontrol_t *pList;

	CScriptObject *pObj;
	CScriptListItem *pItem;

	char szValue[256];
	char strValue[ 256 ];

	pList = m_pList;
	while ( pList )
	{
		pObj = pList->pScrObj;

		if ( !pList->pControl )
		{
			pObj->SetCurValue( pObj->defValue );
			pList = pList->next;
			continue;
		}

		switch ( pObj->type )
		{
		case O_BOOL:
			pBox = (CheckButton *)pList->pControl;
			sprintf( szValue, "%s", pBox->IsSelected() ? "1" : "0" );
			break;
		case O_NUMBER:
			pEdit = ( TextEntry * )pList->pControl;
			pEdit->GetText( strValue, sizeof( strValue ) );
			sprintf( szValue, "%s", strValue );
			break;
		case O_STRING:
			pEdit = ( TextEntry * )pList->pControl;
			pEdit->GetText( strValue, sizeof( strValue ) );
			sprintf( szValue, "%s", strValue );
			break;
		case O_LIST:
			pCombo = ( ComboBox *)pList->pControl;
			pCombo->GetText( strValue, sizeof( strValue ) );
			
			pItem = pObj->pListItems;
			int n = (int)pObj->fdefValue;

			while ( pItem )
			{
				if ( !stricmp( pItem->szItemText, strValue ) )
				{
					break;
				}
				pItem = pItem->pNext;
			}

			if ( pItem )
			{
				sprintf( szValue, "%s", pItem->szValue );
			}
			else  //Couln't find index
			{
				sprintf( szValue, "%s", pObj->defValue );
			}
			break;
		}

		// Remove double quotes and % characters
		UTIL_StripInvalidCharacters( szValue );

		strcpy( strValue, szValue );

		pObj->SetCurValue( strValue );

		pList = pList->next;
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:86,代码来源:CreateMultiplayerGameGameplayPage.cpp

示例4: GatherCurrentValues

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTFOptionsAdvancedPanel::GatherCurrentValues()
{
	if (!m_pDescription)
		return;

	// OK
	CTFAdvCheckButton *pBox;
	TextEntry *pEdit;
	ComboBox *pCombo;
	CTFAdvSlider *pScroll;

	mpcontrol_t *pList;

	CScriptObject *pObj;
	CScriptListItem *pItem;

	char szValue[256];
	char strValue[256];
	int iValue;

	pList = m_pList;
	while (pList)
	{
		pObj = pList->pScrObj;

		if (!pList->pControl)
		{
			pObj->SetCurValue(pObj->defValue);
			pList = pList->next;
			continue;
		}

		switch (pObj->type)
		{
		case O_BOOL:
			pBox = (CTFAdvCheckButton *)pList->pControl;
			sprintf(szValue, "%s", pBox->IsSelected() ? "1" : "0");
			break;
		case O_NUMBER:
			pEdit = (TextEntry *)pList->pControl;
			pEdit->GetText(strValue, sizeof(strValue));
			sprintf(szValue, "%s", strValue);
			break;
		case O_SLIDER:
			pScroll = (CTFAdvSlider *)pList->pControl;
			iValue = pScroll->GetValue();
			sprintf(szValue, "%i", iValue);
			break;
		case O_STRING:
			pEdit = (TextEntry *)pList->pControl;
			pEdit->GetText(strValue, sizeof(strValue));
			sprintf(szValue, "%s", strValue);
			break;
		case O_CATEGORY:
			break;
		case O_LIST:
			pCombo = (ComboBox *)pList->pControl;
			pCombo->GetText( strValue, sizeof( strValue ) );
			int activeItem = pCombo->GetActiveItem();

			pItem = pObj->pListItems;
			//			int n = (int)pObj->fdefValue;

			while (pItem)
			{
				if (!activeItem--)
					break;

				pItem = pItem->pNext;
			}

			if (pItem)
			{
				sprintf(szValue, "%s", pItem->szValue);
			}
			else  // Couln't find index
			{
				//assert(!("Couldn't find string in list, using default value"));
				sprintf(szValue, "%s", pObj->defValue);
			}
			break;
		}

		// Remove double quotes and % characters
		UTIL_StripInvalidCharacters(szValue, sizeof(szValue));

		strcpy(strValue, szValue);

		pObj->SetCurValue(strValue);

		pList = pList->next;
	}
}
开发者ID:Navton,项目名称:TF2Classic,代码行数:96,代码来源:tf_optionsadvancedpanel.cpp


注:本文中的TextEntry::GetText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。