added progress bar, navigation after inputting address

This commit is contained in:
James Shiffer 2020-08-20 14:52:29 -07:00
parent ae3807fc34
commit e6a1b36575
3 changed files with 31 additions and 16 deletions

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <stdio.h> #include <stdio.h>
#include "Etherscan.h" #include "Etherscan.h"
#include "Main.h"
using namespace System; using namespace System;
using namespace System::ComponentModel; using namespace System::ComponentModel;
@ -145,9 +146,9 @@ namespace FemboyBanking {
// //
// progressBar // progressBar
// //
this->progressBar->Location = System::Drawing::Point(12, 106); this->progressBar->Location = System::Drawing::Point(12, 112);
this->progressBar->Name = L"progressBar"; this->progressBar->Name = L"progressBar";
this->progressBar->Size = System::Drawing::Size(298, 23); this->progressBar->Size = System::Drawing::Size(298, 18);
this->progressBar->TabIndex = 6; this->progressBar->TabIndex = 6;
this->progressBar->UseWaitCursor = true; this->progressBar->UseWaitCursor = true;
// //
@ -155,7 +156,7 @@ namespace FemboyBanking {
// //
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(322, 105); this->ClientSize = System::Drawing::Size(322, 103);
this->Controls->Add(this->progressBar); this->Controls->Add(this->progressBar);
this->Controls->Add(this->label2); this->Controls->Add(this->label2);
this->Controls->Add(this->label1); this->Controls->Add(this->label1);
@ -185,9 +186,11 @@ namespace FemboyBanking {
this->ethTextBox->UseSystemPasswordChar = this->privacyCheckBox->Checked; this->ethTextBox->UseSystemPasswordChar = this->privacyCheckBox->Checked;
} }
System::Void cancelBtn_Click(System::Object^ sender, System::EventArgs^ e) { System::Void cancelBtn_Click(System::Object^ sender, System::EventArgs^ e) {
this->Close(); Application::Exit();
} }
System::Void doneBtn_Click(System::Object^ sender, System::EventArgs^ e) { System::Void doneBtn_Click(System::Object^ sender, System::EventArgs^ e) {
this->ethTextBox->Enabled = false;
this->Height += 40;
etherscanWorker->RunWorkerAsync( this->ethTextBox->Text ); etherscanWorker->RunWorkerAsync( this->ethTextBox->Text );
} }
System::Void etherscanWorker_DoWork(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e) { System::Void etherscanWorker_DoWork(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e) {
@ -206,10 +209,17 @@ namespace FemboyBanking {
Double balance = (UInt64) e->Result / 1e18; Double balance = (UInt64) e->Result / 1e18;
String^ balanceMsg = String::Format("You have {0} LINK", balance); String^ balanceMsg = String::Format("You have {0} LINK", balance);
MessageBox::Show(this, balanceMsg, "Wallet Balance Retrieved", MessageBoxButtons::OK, MessageBoxIcon::Information); MessageBox::Show(this, balanceMsg, "Wallet Balance Retrieved", MessageBoxButtons::OK, MessageBoxIcon::Information);
Main^ form = gcnew Main(this->ethTextBox->Text, balance);
this->Owner = form;
this->Owner->Show();
this->Hide();
} }
this->ethTextBox->Enabled = true;
this->Height -= 40;
} }
System::Void etherscanWorker_ProgressChanged(System::Object^ sender, System::ComponentModel::ProgressChangedEventArgs^ e) { System::Void etherscanWorker_ProgressChanged(System::Object^ sender, System::ComponentModel::ProgressChangedEventArgs^ e) {
// this->progressBar->Value = e->progressPercentage; this->progressBar->Value = e->ProgressPercentage;
} }
}; };
} }

View File

@ -97,7 +97,7 @@
IntermediateDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1" ConfigurationType="1"
CharacterSet="1" CharacterSet="1"
ManagedExtensions="2" ManagedExtensions="1"
WholeProgramOptimization="1" WholeProgramOptimization="1"
> >
<Tool <Tool
@ -117,6 +117,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)thirdparty\rapidjson-1.1.0\include&quot;"
PreprocessorDefinitions="WIN32;NDEBUG" PreprocessorDefinitions="WIN32;NDEBUG"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"

View File

@ -1,6 +1,5 @@
#pragma once #pragma once
namespace FemboyBanking { namespace FemboyBanking {
using namespace System; using namespace System;
@ -22,12 +21,14 @@ namespace FemboyBanking {
public ref class Main : public System::Windows::Forms::Form public ref class Main : public System::Windows::Forms::Form
{ {
public: public:
Main(void) Main(String^ ethAddress, Double linkBalance)
{ {
InitializeComponent(); InitializeComponent();
// //
//TODO: Add the constructor code here //TODO: Add the constructor code here
// //
this->ethAddress = ethAddress;
this->linkBalance = linkBalance;
} }
protected: protected:
@ -47,10 +48,9 @@ namespace FemboyBanking {
private: System::Windows::Forms::Button^ withBtn; private: System::Windows::Forms::Button^ withBtn;
private: System::Windows::Forms::Button^ logBtn; private: System::Windows::Forms::Button^ logBtn;
private:
double linkBalance;
String^ ethAddress;
protected:
private: private:
/// <summary> /// <summary>
@ -89,9 +89,9 @@ namespace FemboyBanking {
static_cast<System::Byte>(0))); static_cast<System::Byte>(0)));
this->balLbl->Location = System::Drawing::Point(36, 40); this->balLbl->Location = System::Drawing::Point(36, 40);
this->balLbl->Name = L"balLbl"; this->balLbl->Name = L"balLbl";
this->balLbl->Size = System::Drawing::Size(110, 13); this->balLbl->Size = System::Drawing::Size(67, 13);
this->balLbl->TabIndex = 1; this->balLbl->TabIndex = 1;
this->balLbl->Text = L"BALANCE: 0 LINK"; this->balLbl->Text = L"BALANCE:";
// //
// depBtn // depBtn
// //
@ -138,6 +138,7 @@ namespace FemboyBanking {
this->MaximizeBox = false; this->MaximizeBox = false;
this->Name = L"Main"; this->Name = L"Main";
this->Text = L"FemboyBanking"; this->Text = L"FemboyBanking";
this->Load += gcnew System::EventHandler(this, &Main::Main_Load);
this->ResumeLayout(false); this->ResumeLayout(false);
this->PerformLayout(); this->PerformLayout();
@ -146,11 +147,14 @@ namespace FemboyBanking {
private: System::Void depBtn_Click(System::Object^ sender, System::EventArgs^ e) { private: System::Void depBtn_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show( this, "You selected DEPOSIT", "FemboyBanking Alert", MessageBoxButtons::OK, MessageBoxIcon::Information ); MessageBox::Show( this, "You selected DEPOSIT", "FemboyBanking Alert", MessageBoxButtons::OK, MessageBoxIcon::Information );
} }
private: System::Void withBtn_Click(System::Object^ sender, System::EventArgs^ e) { private: System::Void withBtn_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show( this, "You selected WITHDRAW", "FemboyBanking Alert", MessageBoxButtons::OK, MessageBoxIcon::Information ); MessageBox::Show( this, "You selected WITHDRAW", "FemboyBanking Alert", MessageBoxButtons::OK, MessageBoxIcon::Information );
} }
private: System::Void logBtn_Click(System::Object^ sender, System::EventArgs^ e) { private: System::Void logBtn_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show( this, "You selected TRANSACTION LOG", "FemboyBanking Alert", MessageBoxButtons::OK, MessageBoxIcon::Information ); MessageBox::Show( this, "You selected TRANSACTION LOG", "FemboyBanking Alert", MessageBoxButtons::OK, MessageBoxIcon::Information );
} }
private: System::Void Main_Load(System::Object^ sender, System::EventArgs^ e) {
this->balLbl->Text = String::Format("BALANCE: {0} LINK", this->linkBalance);
}
}; };
} }