• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TextEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: system

//-----------------------------------------------------------------------------
// Purpose: Adds lines to the text entry every second.
//-----------------------------------------------------------------------------
void TextEntryDemo4::OnTick()
{
	if (m_iTimeoutTime)
	{
		int currentTime = system()->GetTimeMillis();
		
		// Check for timeout
		if (currentTime > m_iTimeoutTime)
		{	
			char buf[125];
			sprintf (buf, "Additional Text %d\n", m_iTimeoutTime);

			// Move to the end of the history before we add some new text.
			// Its important to call this and explicitly move to the
			// correct position in case someone clicked in
			// the window (this moves the cursor)
			// If you comment out this line and rerun you will see
			// that if you click in the text window additional
			// text will be added where you clicked.
			m_pTextEntry->DoGotoTextEnd();

			// Add some text to the text entry window
			m_pTextEntry->DoInsertString(buf);

			// Timed out, make a new timeout time
			m_iTimeoutTime = system()->GetTimeMillis() + TIMEOUT;
		}
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:32,代码来源:TextEntryDemo4.cpp


示例2: 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


示例3: 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


示例4: l_set_color

	static int l_set_color(lua_State *l)
	{
		TextEntry *te = LuaObject<UI::TextEntry>::CheckFromLua(1);
		Color c = Color::FromLuaTable(l, 2);
		te->SetColor(c);
		lua_pushvalue(l, 1);
		return 1;
	}
开发者ID:MeteoricGames,项目名称:pioneer,代码行数:8,代码来源:LuaTextEntry.cpp


示例5: SetControlText

//-----------------------------------------------------------------------------
// Purpose: Sets the text of a control by name
//-----------------------------------------------------------------------------
void CDialogGameInfo::SetControlText(const char *textEntryName, const char *text)
{
	TextEntry *entry = dynamic_cast<TextEntry *>(FindChildByName(textEntryName));
	if (entry)
	{
		entry->SetText(text);
	}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:11,代码来源:DialogGameInfo.cpp


示例6: SetControlText

//-----------------------------------------------------------------------------
// Purpose: Sets the text of a control by name
//-----------------------------------------------------------------------------
void CConfigPanel::SetControlText(const char *textEntryName, const char *text)
{
	TextEntry *entry = dynamic_cast<TextEntry *>(FindChildByName(textEntryName));
	if (entry)
	{
		entry->SetText(text);
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:11,代码来源:ConfigPanel.cpp


示例7: l_set_text

	static int l_set_text(lua_State *l)
	{
		TextEntry *te = LuaObject<UI::TextEntry>::CheckFromLua(1);
		std::string new_text;
		pi_lua_generic_pull(l, 2, new_text);
		te->SetText(new_text);
		lua_pushvalue(l, 1);
		return 1;
	}
开发者ID:MeteoricGames,项目名称:pioneer,代码行数:9,代码来源:LuaTextEntry.cpp


示例8: ApplySchemeSettings

	virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
	{
		BaseClass::ApplySchemeSettings( pScheme );
		TextEntry *pTextEntryUserName = dynamic_cast< TextEntry * >( FindChildByName( "UserNameTextEntry" ) );
		if ( pTextEntryUserName )
		{
			pTextEntryUserName->SetText( "" );
			pTextEntryUserName->InsertString( youtube_username.GetString() );
		}
	}
开发者ID:hekar,项目名称:luminousforts-2013,代码行数:10,代码来源:replayyoutubeapi.cpp


示例9: SetChildText

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *panelName - 
//			*valueName - 
//-----------------------------------------------------------------------------
void CDialogUserInfo::SetChildText(const char *panelName, const char *valueName)
{
	TextEntry *text = dynamic_cast<TextEntry *>(FindChildByName(panelName));
	if (text)
	{
		char buf[512];
		strncpy(buf, GetDoc()->GetBuddy(m_iUserID)->Data()->GetString(valueName, ""), sizeof(buf) - 1);
		buf[511] = 0;
		text->SetText(buf);
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:16,代码来源:DialogUserInfo.cpp


示例10:

//-----------------------------------------------------------------------------
// Purpose: When the enter key is pressed we clear the textentry.
//  To add a newline use ctrl-return.
//-----------------------------------------------------------------------------
void TextEntryDemo5::OnKeyCodeTyped(KeyCode code)
{
	if (code == KEY_ENTER)
	{
		m_pTextEntry->SetText("");
	}

	DemoPage::OnKeyCodeTyped(code);
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:13,代码来源:TextEntryDemo5.cpp


示例11: while

//-----------------------------------------------------------------------------
// Purpose: Creates all the controls in the game options list
//-----------------------------------------------------------------------------
void CCreateMultiplayerGameGameplayPage::LoadGameOptionsList()
{
	// destroy any existing controls
	mpcontrol_t *p, *n;

	p = m_pList;
	while ( p )
	{
		n = p->next;
		//
		delete p->pControl;
		delete p->pPrompt;
		delete p;
		p = n;
	}

	m_pList = NULL;


	// Go through desciption creating controls
	CScriptObject *pObj;

	pObj = m_pDescription->pObjList;

	mpcontrol_t	*pCtrl;

	CheckButton *pBox;
	TextEntry *pEdit;
	ComboBox *pCombo;
	CScriptListItem *pListItem;

	Panel *objParent = m_pOptionsList;

	while ( pObj )
	{
		pCtrl = new mpcontrol_t( objParent, "mpcontrol_t" );
		pCtrl->type = pObj->type;

		switch ( pCtrl->type )
		{
		case O_BOOL:
			pBox = new CheckButton( pCtrl, "DescCheckButton", pObj->prompt );
			pBox->SetSelected( pObj->fdefValue != 0.0f ? true : false );
			
			pCtrl->pControl = (Panel *)pBox;
			break;
		case O_STRING:
		case O_NUMBER:
			pEdit = new TextEntry( pCtrl, "DescTextEntry");
			pEdit->InsertString(pObj->defValue);
			pCtrl->pControl = (Panel *)pEdit;
			break;
		case O_LIST:
			pCombo = new ComboBox( pCtrl, "DescComboBox", 5, false );

			pListItem = pObj->pListItems;
			while ( pListItem )
			{
				pCombo->AddItem(pListItem->szItemText, NULL);
				pListItem = pListItem->pNext;
			}

			pCombo->ActivateItemByRow((int)pObj->fdefValue);

			pCtrl->pControl = (Panel *)pCombo;
			break;
		default:
			break;
		}

		if ( pCtrl->type != O_BOOL )
		{
			pCtrl->pPrompt = new vgui::Label( pCtrl, "DescLabel", "" );
			pCtrl->pPrompt->SetContentAlignment( vgui::Label::a_west );
			pCtrl->pPrompt->SetTextInset( 5, 0 );
			pCtrl->pPrompt->SetText( pObj->prompt );
		}

		pCtrl->pScrObj = pObj;
		pCtrl->SetSize( 100, 28 );
		//pCtrl->SetBorder( scheme()->GetBorder(1, "DepressedButtonBorder") );
		m_pOptionsList->AddItem( pCtrl );

		// Link it in
		if ( !m_pList )
		{
			m_pList = pCtrl;
			pCtrl->next = NULL;
		}
		else
		{
			mpcontrol_t *p;
			p = m_pList;
			while ( p )
			{
				if ( !p->next )
				{
//.........这里部分代码省略.........
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:101,代码来源:CreateMultiplayerGameGameplayPage.cpp


示例12: BuildStringSheet

void CSheet_Array::UpdateArrayBlocks( const int &dest_x, const int &dest_y )
{
	int old_x, old_y;
	old_x = old_y = 0;
	char ***oldEntires = BuildStringSheet( old_x, old_y );

	for ( int y = 0; y < old_y; y++ )
	{
		//for ( int x = 0; x < old_x; x++ )
		m_hArray_Y_Major[y]->Purge();
		delete m_hArray_Y_Major[y];
	}
	m_hArray_Y_Major.Purge();

	int iCurItem = m_pArrayPanel->FirstItem();
	while ( iCurItem != m_pArrayPanel->InvalidItemID() )
	{
		Panel *pA = m_pArrayPanel->GetItemLabel( iCurItem );
		Panel *pB = m_pArrayPanel->GetItemPanel( iCurItem );
		if ( pA != NULL )
			pA->MarkForDeletion();
		if ( pB != NULL )
			pB->MarkForDeletion();
		iCurItem = m_pArrayPanel->NextItem( iCurItem );
	}
	m_pArrayPanel->DeleteAllItems();
	m_pArrayPanel->RemoveAll();

	for ( int y = 0; y < dest_y; y++ )
	{
		CUtlVector< TextEntry* > *cur = new CUtlVector< TextEntry* >;
		m_hArray_Y_Major.AddToTail( cur );
	}

	m_pArrayPanel->SetNumColumns( dest_y );
	for ( int x = 0; x < dest_x; x++ )
	{
		for ( int y = 0; y < dest_y; y++ )
		{
			CUtlVector< TextEntry* > *cur = m_hArray_Y_Major[y];

			TextEntry *pEntry = new TextEntry( m_pArrayPanel, "arrayslot" );
			pEntry->AddActionSignalTarget( this );
			cur->AddToTail( pEntry );

			if ( x < old_x &&
				y < old_y && oldEntires != NULL )
			{
				pEntry->SetText( oldEntires[x][y] );
			}
			else
				pEntry->SetText( "0" );

			Label *pHeader = NULL;
			if ( y == 0 )
				pHeader = new Label( m_pArrayPanel, "", VarArgs( "%i:", x ) );

			m_pArrayPanel->AddItem( pHeader, pEntry );
			pEntry->MakeReadyForUse();
			pEntry->InvalidateLayout( true, true );
			pEntry->SetBgColor( TOKENCHANNELS_SUPPORTED_COLOR );
		}
	}
	m_pArrayPanel->SetFirstColumnWidth( 20 );

	if ( oldEntires != NULL )
		DestroyStringSheet( oldEntires, old_x, old_y );
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:68,代码来源:vsheet_array.cpp


示例13: while

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTFOptionsAdvancedPanel::CreateControls()
{
	BaseClass::CreateControls();

	// Go through desciption creating controls
	CScriptObject *pObj;
	pObj = m_pDescription->pObjList;
	
	mpcontrol_t	*pCtrl;
	CTFAdvCheckButton *pBox;
	TextEntry *pEdit;
	ComboBox *pCombo;
	CTFAdvSlider *pScroll;
	CTFAdvButton *pTitle;
	CScriptListItem *pListItem;
	

	Panel *objParent = m_pListPanel;
	while (pObj)
	{
		//Msg("\nAdded: %s %s %f %f %i\n", pObj->prompt, pObj->cvarname, pObj->fcurValue, pObj->fdefValue, pObj->type);
		
		if (pObj->type == O_OBSOLETE)
		{
			pObj = pObj->pNext;
			continue;
		}

		pCtrl = new mpcontrol_t(objParent, "mpcontrol_t");
		pCtrl->type = pObj->type;

	
		switch (pCtrl->type)
		{
		case O_BOOL:
			pBox = new CTFAdvCheckButton(pCtrl, "DescCheckButton", pObj->prompt);
			pBox->SetSelected(pObj->fdefValue != 0.0f ? true : false);
			pBox->SetCommandString(pObj->cvarname);
			pBox->GetButton()->SetFontByString(m_pListPanel->GetFontString());
			if (pObj->tooltip[0] != '\0')
			{
				wchar_t *pText = g_pVGuiLocalize->Find(pObj->tooltip);
				if (pText != NULL)
				{
					char pszToolTipLocal[256];
					wcstombs(pszToolTipLocal, pText, sizeof(pszToolTipLocal));
					pBox->SetToolTip(pszToolTipLocal);
				}
				else
				{
					pBox->SetToolTip(pObj->tooltip);
				}
			}
			pCtrl->pControl = (Panel *)pBox;
			break;
		case O_STRING:
		case O_NUMBER:
			pEdit = new TextEntry(pCtrl, "DescTextEntry");
			pEdit->InsertString(pObj->defValue);
			pCtrl->pControl = (Panel *)pEdit;
			break;
		case O_SLIDER:
			pScroll = new CTFAdvSlider(pCtrl, "DescScrollEntry", pObj->prompt);
			pScroll->SetValue(pObj->fdefValue);
			pScroll->SetCommandString(pObj->cvarname);
			pScroll->SetMinMax(pObj->fMin, pObj->fMax);
			pScroll->GetButton()->SetFontByString(m_pListPanel->GetFontString());
			pCtrl->pControl = (Panel *)pScroll;
			break;
		case O_LIST:
			pCombo = new ComboBox(pCtrl, "DescComboBox", 5, false);

			pListItem = pObj->pListItems;
			while (pListItem)
			{
				pCombo->AddItem(pListItem->szItemText, NULL);
				pListItem = pListItem->pNext;
			}

			pCombo->ActivateItemByRow((int)pObj->fdefValue);

			pCtrl->pControl = (Panel *)pCombo;
			break;
		case O_CATEGORY:
			pTitle = new CTFAdvButton(pCtrl, "DescTextTitle", pObj->prompt);
			pTitle->SetEnabled(false);
			pTitle->SetBorderByString("AdvSettingsTitleBorder");
			pTitle->SetBorderVisible(true);
			pTitle->GetButton()->SetFontByString("MenuSmallFont");
			pCtrl->pControl = (Panel *)pTitle;
			break;
		default:
			break;
		}

		if (pCtrl->type != O_BOOL && pCtrl->type != O_SLIDER && pCtrl->type != O_CATEGORY)
		{
//.........这里部分代码省略.........
开发者ID:Navton,项目名称:TF2Classic,代码行数:101,代码来源:tf_optionsadvancedpanel.cpp


示例14: snd_surround_speakers

//=============================================================================
void Multiplayer::OnCommand(const char *command)
{
	if( Q_stricmp( "#GameUI_Headphones", command ) == 0 )
	{
		CGameUIConVarRef snd_surround_speakers("Snd_Surround_Speakers");
		snd_surround_speakers.SetValue( "0" );
	}
	
	else if ( char const *sz = StringAfterPrefix( command, "#GameUI_DownloadFilter_" ) )
	{
		CGameUIConVarRef  cl_downloadfilter( "cl_downloadfilter" );
		cl_downloadfilter.SetValue( sz );
	}
	else if ( char const *sz = StringAfterPrefix( command, "ColorBlind" ) )
	{
		CGameUIConVarRef cl_colorblind( "cl_colorblind" );
		cl_colorblind.SetValue( sz );
	}
	else if ( char const *sz = StringAfterPrefix( command, "GameInstructor" ) )
	{
		CGameUIConVarRef gameinstructor_enable( "gameinstructor_enable" );
		gameinstructor_enable.SetValue( !Q_stricmp( sz, "Enabled" ) );
	}
	else if ( char const *sz = StringAfterPrefix( command, "AllowFreeLook" ) )
	{
		CGameUIConVarRef spec_allowroaming( "spec_allowroaming" );
		spec_allowroaming.SetValue( !Q_stricmp( sz, "Enabled" ) );
	}
	else if ( char const *sz = StringAfterPrefix( command, "MpLanGames" ) )
	{
		CGameUIConVarRef net_allow_multicast( "net_allow_multicast" );
		net_allow_multicast.SetValue( !Q_stricmp( sz, "Enabled" ) );
	}

	else if ( StringHasPrefix( command, "_spraypaint" ) )
	{
		int iCommandNumberPosition = Q_strlen( MULTIPLAYER_SPRAYPAINT_COMMAND_PREFIX );
		int iLogo = clamp( command[ iCommandNumberPosition ] - '0', 0, m_nNumSpraypaintLogos - 1 );

		if ( m_nSpraypaint[ iLogo ].m_bCustom && m_nSpraypaint[ iLogo ].m_szFilename[ 0 ] == '\0' )
		{
			// Select a file from the custom directory!
			if ( m_hSelectSprayDialog )
			{
				// Always start fresh so the directory refreshes
				m_hSelectSprayDialog->DeletePanel();
				m_hSelectSprayDialog = NULL;
			}

			m_hSelectSprayDialog = new FileOpenDialog(this, "#L4D360UI_Multiplayer_Cutsom_Logo", true);
			m_hSelectSprayDialog->SetProportional( false );
			m_hSelectSprayDialog->SetDeleteSelfOnClose( false );
			m_hSelectSprayDialog->AddFilter("*.vtf", "*.vtf", true);
			m_hSelectSprayDialog->AddActionSignalTarget(this);

			char szCustomSprayDir[ MAX_PATH ];
			Q_snprintf( szCustomSprayDir, sizeof( szCustomSprayDir ), "%s/" MULTIPLAYER_SPRAY_FOLDER MULTIPLAYER_CUSTOM_SPRAY_FOLDER, engine->GetGameDirectory() );
			m_hSelectSprayDialog->SetStartDirectoryContext( "SelectCustomLogo", szCustomSprayDir );

			m_hSelectSprayDialog->DoModal(false);
			m_hSelectSprayDialog->Activate();

			// Hide directory buttons
			m_hSelectSprayDialog->SetControlVisible( "FolderUpButton", false );
			m_hSelectSprayDialog->SetControlVisible( "NewFolderButton", false );
			m_hSelectSprayDialog->SetControlVisible( "OpenInExplorerButton", false );
			m_hSelectSprayDialog->SetControlVisible( "LookInLabel", false );
			m_hSelectSprayDialog->SetControlVisible( "FullPathEdit", false );
			m_hSelectSprayDialog->SetControlVisible( "FileNameLabel", false );

			for ( int i = 0; i < m_hSelectSprayDialog->GetChildCount(); ++i )
			{
				// Need to hide text entry box so they can't manually type ".." and go back a dir
				TextEntry *pTextEntry = dynamic_cast<TextEntry*>( m_hSelectSprayDialog->GetChild( i ) );

				if ( pTextEntry && !dynamic_cast<ComboBox*>( pTextEntry ) )
				{
					pTextEntry->SetVisible( false );
				}
			}
		}
		else
		{
			char *pchCustomPath = ( ( m_nSpraypaint[ iLogo ].m_bCustom ) ? ( MULTIPLAYER_CUSTOM_SPRAY_FOLDER ) : ( "" ) );

			char rootFilename[MAX_PATH];
			Q_snprintf( rootFilename, sizeof(rootFilename), MULTIPLAYER_SPRAY_FOLDER "%s%s.vtf", pchCustomPath, m_nSpraypaint[ iLogo ].m_szFilename );

			CGameUIConVarRef cl_logofile( "cl_logofile", true );
			cl_logofile.SetValue( rootFilename );

			RemapLogo( m_nSpraypaint[ iLogo ].m_szFilename, m_pSprayLogo, pchCustomPath );

			// Clear out the custom image's filename so they will be forced to reselect
			for ( int i = 0; i < MAX_SPRAYPAINT_LOGOS; ++i )
			{
				if ( m_nSpraypaint[ iLogo ].m_bCustom )
				{
					m_nSpraypaint[ iLogo ].m_szFilename[ 0 ] = '\0';
//.........这里部分代码省略.........
开发者ID:Randdalf,项目名称:bliink,代码行数:101,代码来源:vmultiplayer.cpp


示例15: UpdateControlData

//-----------------------------------------------------------------------------
// Purpose: sets up the current control to edit
//-----------------------------------------------------------------------------
void BuildModeDialog::SetActiveControl(Panel *controlToEdit)
{	
	if (m_pCurrentPanel == controlToEdit)
	{
		// it's already set, so just update the property data and quit
		if (m_pCurrentPanel)
		{
			UpdateControlData(m_pCurrentPanel);
		}
		return;
	}

	// reset the data
	m_pCurrentPanel = controlToEdit;
	RemoveAllControls();
	m_pPanelList->m_pControls->MoveScrollBarToTop();

	if (!m_pCurrentPanel)
	{
		m_pStatusLabel->SetText("[nothing currently selected]");
		m_pStatusLabel->SetTextColorState(Label::CS_DULL);
		RemoveAllControls();
		return;
	}

	// get the control description string
	const char *controlDesc = m_pCurrentPanel->GetDescription();

	// parse out the control description
	int tabPosition = 1;
	while (1)
	{
		const char *dataType = ParseTokenFromString(&controlDesc);

		// finish when we have no more tokens
		if (*dataType == 0)
			break;

		// default the data type to a string
		int datat = TYPE_STRING;

		if (!stricmp(dataType, "int"))
		{
			datat = TYPE_STRING; //!! just for now
		}
		else if (!stricmp(dataType, "alignment"))
		{
			datat = TYPE_ALIGNMENT;
		}
		else if (!stricmp(dataType, "autoresize"))
		{
			datat = TYPE_AUTORESIZE;
		}
		else if (!stricmp(dataType, "corner"))
		{
			datat = TYPE_CORNER;
		}
		else if (!stricmp(dataType, "localize"))
		{
			datat = TYPE_LOCALIZEDSTRING;
		}

		// get the field name
		const char *fieldName = ParseTokenFromString(&controlDesc);

		int itemHeight = 18;

		// build a control & label
		Label *label = new Label(this, NULL, fieldName);
		label->SetSize(96, itemHeight);
		label->SetContentAlignment(Label::a_east);

		TextEntry *edit = NULL;
		ComboBox *editCombo = NULL;
		Button *editButton = NULL;
		if (datat == TYPE_ALIGNMENT)
		{
			// drop-down combo box
			editCombo = new ComboBox(this, NULL, 9, false);
			editCombo->AddItem("north-west", NULL);
			editCombo->AddItem("north", NULL);
			editCombo->AddItem("north-east", NULL);
			editCombo->AddItem("west", NULL);
			editCombo->AddItem("center", NULL);
			editCombo->AddItem("east", NULL);
			editCombo->AddItem("south-west", NULL);
			editCombo->AddItem("south", NULL);
			editCombo->AddItem("south-east", NULL);
		
			edit = editCombo;
		}
		else if (datat == TYPE_AUTORESIZE)
		{
			// drop-down combo box
			editCombo = new ComboBox(this, NULL, 4, false);
			editCombo->AddItem( "0 - no auto-resize", NULL);
			editCombo->AddItem( "1 - resize right", NULL);
//.........这里部分代码省略.........
开发者ID:hzqst,项目名称:CaptionMod,代码行数:101,代码来源:BuildModeDialog.cpp


示例16: Assert

//-----------------------------------------------------------------------------
// Sets up the shader param editbox
//-----------------------------------------------------------------------------
void CMaterialEditorPanel::PopulateShaderParameters()
{
	Assert( m_nShaderIndex >= 0 );
	m_pEditorPanel->RemoveAll();
	int nCount = g_pMaterialSystem->GetNumShaderParams(m_nShaderIndex);
	for (int i = 0; i < nCount; ++i)
	{
		const char *pParamName = g_pMaterialSystem->GetShaderParamName(m_nShaderIndex, i);

		char tempBuf[512];
		Q_strncpy( tempBuf, pParamName, 512 );
		Q_strnlwr( tempBuf, 512 );

		// build a control & label (strip off '$' prefix)
		Label *pLabel = new Label( this, NULL, tempBuf + 1 ); 
		pLabel->SetSize(128, 24);
		
		// Set up the tooltip for this puppy...
		pLabel->SetTooltipText( g_pMaterialSystem->GetShaderParamHelp(m_nShaderIndex, i) );

		// Get at the material var
		bool bFound;
		IMaterialVar *pMaterialVar = m_pMaterial->FindVar( pParamName, &bFound );
		Assert( bFound );

		Panel *pEditPanel;
		switch( g_pMaterialSystem->GetShaderParamType(m_nShaderIndex, i) )
		{
		case SHADER_PARAM_TYPE_TEXTURE:
			pEditPanel = new Label( this, NULL, "texture" ); 
			break;

		case SHADER_PARAM_TYPE_INTEGER:
			{
				TextEntry *pTextEntry = new TextEntry(this, "Shader Param Integer");
				Q_snprintf( tempBuf, 512, "%d", pMaterialVar->GetIntValue() );
				pTextEntry->SetText( tempBuf );
				pTextEntry->SetEditable( true );

				pEditPanel = pTextEntry;
			}
			break;

		case SHADER_PARAM_TYPE_COLOR:
			pEditPanel = new Label( this, NULL, "color" ); 
			break;
		case SHADER_PARAM_TYPE_VEC2:
			pEditPanel = new Label( this, NULL, "vec2" ); 
			break;
		case SHADER_PARAM_TYPE_VEC3:
			pEditPanel = new Label( this, NULL, "vec3" ); 
			break;

		case SHADER_PARAM_TYPE_FLOAT:
			{
				TextEntry *pTextEntry = new TextEntry(this, "Shader Param Float");
				Q_snprintf( tempBuf, 512, "%f", pMaterialVar->GetIntValue() );
				pTextEntry->SetText( tempBuf );
				pTextEntry->SetEditable( true );

				pEditPanel = pTextEntry;
			}
			break;

		default:
			pEditPanel = new Label( this, NULL, "other" ); 
			break;
		}

		pEditPanel->SetSize(128, 24);
//		pEditPanel->SetContentAlignment( Label::a_east );
		m_pEditorPanel->AddItem( pLabel, pEditPanel );
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:77,代码来源:mateditpanel.cpp


示例17: do_validate

  virtual void do_validate()
  {
    bool ok= true;

    if (_left_file.get_active())
    {
      if (!g_file_test(_left_filename.get_string_value().c_str(), G_FILE_TEST_IS_REGULAR))
        ok= false;
    }
    if (!ok)
    {
      if (_form)
        _form->set_problem("Select Left File");
      return;
    }
    
    if (_right_file.get_active())
    {
      if (!g_file_test(_right_filename.get_string_value().c_str(), G_FILE_TEST_IS_REGULAR))
        ok= false;
    }
    if (!ok)
    {
      if (_form)
        _form->set_problem("Select Right File");
      return;
    }
    if (_form)
      _form->set_problem("");
  }
开发者ID:Sonano,项目名称:mysql-workbench,代码行数:30,代码来源:wiztest.cpp


示例18: right_changed

 void right_changed()
 {
   if (_right_model.get_active())
   {
     _left_model.set_enabled(false);
     _right_filebox_b.set_enabled(false);
     _right_filename.set_enabled(false);
   }
   else if (_right_db.get_active())
   {
     _left_model.set_enabled(true);
     _right_filebox_b.set_enabled(false);
     _right_filename.set_enabled(false);
   }
   else
   {
     _left_model.set_enabled(true);
     _right_filebox_b.set_enabled(true);
     _right_filename.set_enabled(true);
   }
   validate();
 }
开发者ID:Sonano,项目名称:mysql-workbench,代码行数:22,代码来源:wiztest.cpp


示例19: WizardPage

  Page1(WizardForm *form)
    : WizardPage(form, "pg1"), 
      _left_panel(true), _left_vbox(false), _left_filebox(true),
      _right_panel(true), _right_vbox(false), _right_filebox(true),
      _top_level(true)
  {
    set_title("Catalog synchronization");
    set_subtitle("Select your catalog objects for synchronization");

    add(&_top_level, false, true);

    _left_panel.set_title("Source for the Left Catalog");
    _left_panel.add(&_left_vbox);

    _left_model.set_text("Model Schemata");
    _left_db.set_text("Live Database Server");
    _left_file.set_text("SQL Script File");
    _left_model.signal_toggled().connect(sigc::mem_fun(this, &Page1::left_changed));
    _left_db.signal_toggled().connect(sigc::mem_fun(this, &Page1::left_changed));
    _left_file.signal_toggled().connect(sigc::mem_fun(this, &Page1::left_changed));

    _left_vbox.set_spacing(8);
    _left_vbox.set_padding(8);

    _left_filebox.set_spacing(4);
    _left_filebox_l.set_text("File Name:");
    _left_filebox_b.set_text("Browse...");
    _left_filebox_b.set_size(100, -1);
    _left_filename.set_size(30, -1);
    
    _left_filebox.add(&_left_filebox_l, false, true);
    _left_filebox.add(&_left_filename, true, true);
    _left_filebox.add(&_left_filebox_b, false, false);

    enable_file_browsing(&_left_filename, &_left_filebox_b, mforms::OpenFile);

    _left_vbox.add(&_left_model, false, true);
    _left_vbox.add(&_left_db, false, true);
    _left_vbox.add(&_left_file, false, true);
    _left_vbox.add(&_left_filebox, false, true);


    _right_panel.set_title("Source for the Right Catalog");
    _right_panel.add(&_right_vbox);

    _right_model.set_text("Model Schemata");
    _right_db.set_text("Live Database Server");
    _right_file.set_text("SQL Script File");
    _right_model.signal_toggled().connect(sigc::mem_fun(this, &Page1::right_changed));
    _right_db.signal_toggled().connect(sigc::mem_fun(this, &Page1::right_changed));
    _right_file.signal_toggled().connect(sigc::mem_fun(this, &Page1::right_changed));

    _right_filebox.set_spacing(4);
    _right_filebox_l.set_text("File Name:");
    _right_filebox_b.set_text("Browse...");
    _right_filebox_b.set_size(100, -1);
    _right_filename.set_size(30, -1);
    _right_filebox.add(&_right_filebox_l, false, true);
    _right_filebox.add(&_right_filename, true, true);
    _right_filebox.add(&_right_filebox_b, false, false);

    enable_file_browsing(&_right_filename, &_right_filebox_b, mforms::OpenFile);

    _right_vbox.set_spacing(8);
    _right_vbox.set_padding(8);

    _right_vbox.add(&_right_model, false, true);
    _right_vbox.add(&_right_db, false, true);
    _right_vbox.add(&_right_file, false, true);
    _right_vbox.add(&_right_filebox, false, true);
    
    _right_file.set_active(true);

    _top_level.set_homogeneous(true);
    _top_level.add(&_left_panel, false, true);
    _top_level.add(&_right_panel, false, true);
    
    _top_level.set_padding(12);
    _top_level.set_spacing(12);
  }
开发者ID:Sonano,项目名称:mysql-workbench,代码行数:80,代码来源:wiztest.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TextEvent类代码示例发布时间:2022-05-31
下一篇:
C++ TextEncoding类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap