janelaAtualizacao.cpp 4.07 KB
#include "janelaAtualizacao.h"
#include "Util.h"


JanelaAtualizacao::JanelaAtualizacao()
{	
	initializeComponent();
}

void JanelaAtualizacao::initializeComponent()
{

	this->downloading = true;
	this->Size = System::Drawing::Size(500, 250);
	this->progressBar1 = (gcnew ProgressBar());
	this->btOK = (gcnew Button());
	this->lbInfDownload = (gcnew Label());
	this->lbInformacao = (gcnew Label());
	this->Name = "Vlibras-Desktop-Update"; 
	this->Text = "Atualização - Vlibras-Desktop";
	this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
	this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
	//this->ControlBox = false;
	this->MaximizeBox = false;
	this->BackColor = Drawing::Color::White;
    //this->MinimizeBox = false; 
    //this->BackgroundImage = Image::FromFile("c:\\vlibras-libs\\image\\background.png");
	//this->Opacity = 0.97;
	Drawing::Icon^ IC = gcnew Drawing::Icon("c:\\vlibras-libs\\icons\\icon_vlibras.ico");
	this->Icon = IC;	        
	this->SuspendLayout();
	//this->FormBorderStyle = ::FormBorderStyle::None;
	this->FormClosing += gcnew FormClosingEventHandler(this, &JanelaAtualizacao::XFormClosing); 
	
	// progressBar1
	// 
	this->progressBar1->Location = Point(7, 85);
	this->progressBar1->Name = "progressBar1";
	this->progressBar1->Size = System::Drawing::Size(470, 30);
	//this->progressBar1->TabIndex = 0;
	this->progressBar1->Minimum = 0;
	this->progressBar1->Maximum = 100;
	//this->progressBar1->Style = ProgressBarStyle::Marquee;
	//progressBar1->Visible = false;
    //progressBar1->Enabled = false;
	// 
	
	// 
	this->lbInformacao->Location = Point(7, 15);
	this->lbInformacao->Name = "label";
	this->lbInformacao->Size = System::Drawing::Size(470, 23);
	this->lbInformacao->BackColor = Drawing::Color::Transparent;
	//this->lbInformacao->ForeColor=Drawing::Color::White;

	// 
	this->lbInfDownload->Location = Point(7, 120);
	this->lbInfDownload->Name = "labelDownload";
	this->lbInfDownload->Size = System::Drawing::Size(470, 23);
	this->lbInfDownload->BackColor = Drawing::Color::Transparent;
	//this->lbInfDownload->Font = gcnew System::Drawing::Font("Arial", 12);
	//this->lbInfDownload->ForeColor=Drawing::Color::White;

	
	// btOK
	// 
	
	this->btOK->Location = Point(390, this->Bottom-80);
	this->btOK->Name = "btOK";
	this->btOK->Size = System::Drawing::Size(80, 30);
	this->btOK->TabIndex = 1;
	this->btOK->Text = "OK";
	this->btOK->UseVisualStyleBackColor = true;
	this->btOK->Click += gcnew EventHandler(this, &JanelaAtualizacao::btOKevent); 
	//this->btOK
	// 
	
	// 
	//this->Controls->Add(this->topo);
	this->Controls->Add(this->lbInformacao);
	this->Controls->Add(this->lbInfDownload);
	this->Controls->Add(this->progressBar1);
	this->Controls->Add(this->btOK); 
	this->btOK->Enabled = false;
	//this->Controls->Add(this->richTextBox1);
	
	//this->ResumeLayout(false);

}

void JanelaAtualizacao::setInfoWhite(String^ info)
{
	this->lbInformacao->Location = Point(7, 20);
	this->lbInformacao->Font = gcnew System::Drawing::Font("Serif", 12);
	this->lbInformacao->Text = info;
	//this->lbInformacao->ForeColor=Drawing::Color::White;
	this->lbInformacao->TextAlign = ContentAlignment::MiddleCenter;

}

void JanelaAtualizacao::setInfoGreen(String^ info)
{
	this->lbInformacao->Location = Point(7, 75);
	this->lbInformacao->Font = gcnew System::Drawing::Font("Arial", 15);
	this->lbInformacao->Text = info;
	this->lbInformacao->ForeColor=Drawing::Color::Green;
	this->lbInformacao->TextAlign = ContentAlignment::MiddleCenter;

}
void JanelaAtualizacao::setInfoRed(String^ info)
{
	this->lbInformacao->Location = Point(7, 75);
	this->lbInformacao->Font = gcnew System::Drawing::Font("Arial", 15);
	this->lbInformacao->Text = info;
	this->lbInformacao->ForeColor=Drawing::Color::Red;
	this->lbInformacao->TextAlign = ContentAlignment::MiddleCenter;

}



    
void JanelaAtualizacao::btOKevent(Object^ sender, EventArgs^ e)
{
	
	this->Close();

} 



void JanelaAtualizacao::start()
{
	
} 


void JanelaAtualizacao::EnableButton()
{
	btOK->Enabled = true;
}


void JanelaAtualizacao::XFormClosing(Object^ sender, FormClosingEventArgs^ e)
{
	 
}