コード例 #1
0
CASW_VGUI_Edit_Emitter_SaveDialog::CASW_VGUI_Edit_Emitter_SaveDialog( vgui::Panel *pParent, const char *pElementName, CASW_VGUI_Edit_Emitter* pEditFrame ) 
 :	vgui::Frame( pParent, pElementName )
{	
	m_pEditFrame = pEditFrame;
	SetTitle("Save Template", true);
	SetSizeable(false);
	SetMoveable(false);
	SetTall(140);
	SetWide(320);
	SetCloseButtonVisible(false);
	MoveToCenterOfScreen();

	vgui::Label* pPleaseLabel = new vgui::Label(this, "SaveDLabel", "Please enter a name to save this template as:");
	pPleaseLabel->SetPos(20,25);
	pPleaseLabel->SetWide(290);
	pPleaseLabel->SetTall(20);

	//vgui::Label* pLabel = new vgui::Label(this, "SaveDLabel", "Template Name:");
	//pLabel->SetPos(20,45);
	//pLabel->SetWide(220);
	//pLabel->SetTall(20);

	m_pSaveText = new vgui::TextEntry(this, "SaveDText");
	m_pSaveText->SetPos(20,45);
	m_pSaveText->SetWide(220);
	m_pSaveText->SetTall(20);
	char buf[MAX_PATH];
	m_pEditFrame->m_pTemplateCombo->GetText(buf, MAX_PATH);
	m_pSaveText->SetText(buf);

	m_pSaveButton = new vgui::Button(this, "SaveDButton", "Save");
	m_pSaveButton->SetCommand(new KeyValues("SaveDButton"));
	m_pSaveButton->SetWide(60);
	m_pSaveButton->SetTall(20);
	m_pSaveButton->SetPos(190, 115);
	m_pSaveButton->AddActionSignalTarget(this);

	m_pCancelButton = new vgui::Button(this, "CancelDButton", "Cancel");
	m_pCancelButton->SetCommand(new KeyValues("CancelDButton"));
	m_pCancelButton->SetWide(60);
	m_pCancelButton->SetTall(20);
	m_pCancelButton->SetPos(255, 115);
	m_pCancelButton->AddActionSignalTarget(this);

	m_pExistsLabel = new vgui::Label(this, "ExistsLabel", " ");
	m_pExistsLabel->SetPos(20,70);
	m_pExistsLabel->SetWide(300);
	m_pExistsLabel->SetTall(40);

	TextEntryChanged(m_pSaveText);
}
コード例 #2
0
CDialog_RendertargetSettings::CDialog_RendertargetSettings( Panel *parent ) : CBaseDiag( parent, NULL, "rtsettings" ) //BaseClass( parent, "rtsettings" )
{
	m_pRTTarget = NULL;

	SetMouseInputEnabled( true );
	SetKeyBoardInputEnabled( true );

	m_pText_RTName = new TextEntry( this, "rt_name" );

	m_pText_SizeX = new TextEntry( this, "rt_size_x" );
	m_pText_SizeY = new TextEntry( this, "rt_size_y" );

	m_pList_Flags = new PanelListPanel( this, "rtlist" );
	m_pList_Flags->SetNumColumns( 1 );
	m_pList_Flags->SetFirstColumnWidth( 0 );
	m_pList_Flags->SetVerticalBufferPixels( 0 );

	for ( int i = 0; i < iNumVTFFlags; i++ )
	{
		CheckButton *pCBut = new CheckButton( m_pList_Flags, "", pszVTFFlags[i] );
		m_pList_Flags->AddItem( NULL, pCBut );
		m_hFlag_Buttons.AddToTail( pCBut );
	}

	m_pCBox_ImgFormat = new ComboBox( this, "cbox_format", 20, false );
	for ( int i = 0; i < iNumImgFormatNames; i++ )
		m_pCBox_ImgFormat->AddItem( pszImgFormatNames[i], NULL );

	m_pCBox_SizeMode = new ComboBox( this, "cbox_sizemode", 20, false );
	for ( int i = 0; i < iNumRTSizeModes; i++ )
		m_pCBox_SizeMode->AddItem( pszRTSizeModes[i], NULL );

	m_pCBox_DepthMode = new ComboBox( this, "cbox_depthmode", 20, false );
	for ( int i = 0; i < iNumRTDepthModes; i++ )
		m_pCBox_DepthMode->AddItem( pszRTDepthModes[i], NULL );

	LoadControlSettings( "shadereditorui/vgui/dialog_rendertarget_settings.res" );

	SetSizeable( false );
	SetTitle( "Rendertarget properties", true );

	SetCloseButtonVisible( false );

	DoModal();
	MoveToCenterOfScreen();
}
コード例 #3
0
//-----------------------------------------------------------------------------
//
// CFileManagerFrame methods 
//
//-----------------------------------------------------------------------------
CFileManagerFrame::CFileManagerFrame( vgui::Panel *parent ) : BaseClass( parent, "FileManagerFrame" )
{
	SetTitle( "#BxFileManagerFrame", true );

	SetSizeable( true );
	SetCloseButtonVisible( false );
	SetMinimumSize( 200, 200 );

	SetVisible( true );

	SetSize( 800, 200 );
	SetPos( 100, 100 );

	m_pFileListManager = new CFileListManager( this );
	Refresh();

	SetScheme( vgui::scheme()->LoadSchemeFromFile( "Resource/BoxRocket.res", "BoxRocket" ) );
}
コード例 #4
0
void CIOSUpdatePanel::ApplySchemeSettings( IScheme *pScheme )
{
	m_pScheme = pScheme;
	BaseClass::ApplySchemeSettings( pScheme );

	SetTitle("IOS Updater", false);
	SetProportional(false);
	SetSizeable(false);
	SetBounds(0, 0, PANEL_WIDTH, PANEL_HEIGHT);
	//SetBgColor(Color(0, 0, 0, 255));
	SetPaintBackgroundEnabled(true);
	SetCloseButtonVisible(false);
	MoveToCenterOfScreen();

	m_pContent->SetBounds(PADDING, PADDING + TOP_PADDING, GetWide() - 2 * PADDING, GetTall() - 2 * PADDING - TOP_PADDING);
	
	m_pUpdateButton->SetBounds(m_pContent->GetWide() / 2 - UPDATE_BUTTON_WIDTH / 2, m_pContent->GetTall() - UPDATE_BUTTON_HEIGHT - BUTTON_MARGIN - BUTTON_HEIGHT, UPDATE_BUTTON_WIDTH, UPDATE_BUTTON_HEIGHT);
	m_pUpdateButton->SetContentAlignment(Label::a_center);
	
	m_pCloseButton->SetBounds(m_pContent->GetWide() / 2 - BUTTON_WIDTH / 2, m_pContent->GetTall() - BUTTON_HEIGHT, BUTTON_WIDTH, BUTTON_HEIGHT);
	m_pCloseButton->SetContentAlignment(Label::a_center);
	
	m_pInfoText->SetBounds(PADDING, 3 * PADDING, m_pContent->GetWide() - 2 * PADDING, INFO_HEIGHT); 
	m_pInfoText->SetFont(pScheme->GetFont("DefaultBig"));
	m_pInfoText->SetContentAlignment(Label::a_center);
	m_pInfoText->SetFgColor(Color(255, 255, 255, 255));

	m_pExtraInfoText->SetBounds(PADDING, 3 * PADDING + INFO_HEIGHT + PADDING, m_pContent->GetWide() - 2 * PADDING, INFO_HEIGHT); 
	m_pExtraInfoText->SetFont(pScheme->GetFont("DefaultBig"));
	m_pExtraInfoText->SetContentAlignment(Label::a_center);
	m_pExtraInfoText->SetFgColor(Color(255, 255, 255, 255));

	m_pExtraInfoText2->SetBounds(PADDING, 3 * PADDING + 2 * (INFO_HEIGHT + PADDING), m_pContent->GetWide() - 2 * PADDING, INFO_HEIGHT); 
	m_pExtraInfoText2->SetFont(pScheme->GetFont("DefaultBig"));
	m_pExtraInfoText2->SetContentAlignment(Label::a_center);
	m_pExtraInfoText2->SetFgColor(Color(255, 255, 255, 255));

	m_pProgressBar->SetBounds(m_pContent->GetWide() / 2 - PROGRESSBAR_WIDTH / 2, 3 * PADDING + 3 * (INFO_HEIGHT + PADDING), PROGRESSBAR_WIDTH, PROGRESSBAR_HEIGHT);

	m_pChangelog->SetBounds(m_pContent->GetWide() / 2 - CHANGELOG_WIDTH / 2, 4 * PADDING + 3 * (INFO_HEIGHT + PADDING) + PROGRESSBAR_HEIGHT, CHANGELOG_WIDTH, CHANGELOG_HEIGHT);
}
コード例 #5
0
void CEditorRoot::ApplySchemeSettings(vgui::IScheme *pScheme)
{
	BaseClass::ApplySchemeSettings(pScheme);

	SetPaintBackgroundEnabled(true);
	SetPaintBorderEnabled(false);
	SetPaintEnabled(true);
	SetCloseButtonVisible(false);
	SetSizeable(false);
	SetMoveable(false);

	InitColors();

	SetTitle( "", true );
	SetTitleBarVisible( false );
	m_pLabelTitle->SetText( GetEditorTitle() );
	m_pLabelTitle->SetFont( pScheme->GetFont( "UiBold", false ) );

	SetPaintBackgroundType( 0 );
	OnShaderNameChanged();
	GenerateFonts(pScheme);
}
コード例 #6
0
ファイル: mainmenu.cpp プロジェクト: NicolasDe/project-9
MainMenu::MainMenu(vgui::Panel* parent) : BaseClass(NULL, "MainMenu")
{
	vgui::HScheme Scheme = vgui::scheme()->LoadSchemeFromFile("resource2/schememainmenu.res", "SchemeMainMenu");
	SetScheme(Scheme);

	SetProportional(false);
	SetPaintBorderEnabled(false);
	SetPaintBackgroundEnabled(false);
	SetDeleteSelfOnClose(true);
	SetSizeable(false);
	SetMoveable(false);
	SetCloseButtonVisible(false);
	SetMenuButtonVisible(false);
	Activate();

	m_bFocused = true;

	m_logoLeft = GameUI2().GetLocalizedString("#GameUI2_LogoLeft");
	m_logoRight = GameUI2().GetLocalizedString("#GameUI2_LogoRight");

	CreateMenu("resource2/mainmenu.res");
}
コード例 #7
0
//
//	Name: CGUIListenServer
//	Author: Hekar Khani
//	Description: GUI Panel to replace Valve's CreateServer
//	Notes: 
//
CGUIListenServer::CGUIListenServer( vgui::VPANEL parent ) :
	BaseClass( NULL, "GUIListenServer" )
{	
	SetParent( parent );
	vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile( "resource/SourceScheme.res", "SourceScheme" );
	SetScheme( scheme );
	LoadControlSettings( "Resource/UI/ListenServer.res" );

	SetVisible( false );
	SetSizeable( false );
	SetMoveable( false );
	SetSmallCaption( true );

	SetMaximizeButtonVisible( false );
	SetMinimizeButtonVisible( false );
	SetCloseButtonVisible( false );
	
	SetMenuButtonResponsive( true );
	SetDeleteSelfOnClose( false );

	GetPropertySheet()->SetSmallTabs( false );

	AddPage( new CPanelListenMain( this ), "Main" );
}
コード例 #8
0
CCode_Editor::CCode_Editor( CSheet_Base *parent, const char *pName, CSmartText::CodeEditMode_t mode ) : BaseClass( parent, pName )
{
	m_iMode = mode;

	Activate();
	SetVisible( true );

	SetPaintBackgroundEnabled(true);
	SetPaintEnabled(true);

	SetSizeable(true);
	SetMoveable(true);
	SetMinimumSize( 500, 400 );

	SetDeleteSelfOnClose( true );

	m_iLastAppliedCodeIndex = 0;

	m_pCodeWindow = new CSmartText( this, "codewindow", mode );
	m_pCodeWindow->AddActionSignalTarget( this );

	/*
	TextEntry *pT = new TextEntry( this, "codewindow" );
	pT->SetMultiline( true );
	pT->SetEditable( true );
	pT->SetCatchEnterKey( true );
	pT->SetVerticalScrollbar( true );
	*/

	LoadControlSettings( "shadereditorui/vgui/code_editor_Window.res" );

	UpdateButtonEnabled( true, true );
	SetCloseButtonVisible(false);

	int w,t;
	surface()->GetScreenSize( w, t );
	w *= 0.75f;
	t *= 0.75f;
	SetSize( max( w, 500 ), max( t, 400 ) );
	
	//SetKeyBoardInputEnabled( false );
	//SetMouseInputEnabled( true );

	//SetTitle( "Editor", true );
	SetTitle( "", false );

	Panel *pButton = FindChildByName( "button_save" );
	if ( pButton )
		pButton->SetKeyBoardInputEnabled( false );

	pButton = FindChildByName( "button_apply" );
	if ( pButton )
		pButton->SetKeyBoardInputEnabled( false );
	pButton = FindChildByName( "button_cancel" );
	if ( pButton )
		pButton->SetKeyBoardInputEnabled( false );

	DoModal();

	int rx, ry, rsx, rsy;
	if ( pEditorRoot->GetCodeEditorBounds( rx, ry, rsx, rsy ) )
		SetBounds( rx, ry, rsx, rsy );
	else
		MoveToCenterOfScreen();
}