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);
}
Exemple #2
0
void caTextEntry::dataInput()
{
    //printf("return pressed %s\n", text().toAscii().constData());
    emit TextEntryChanged(text());
}