Skip to content
This repository has been archived by the owner on Sep 7, 2019. It is now read-only.

Commit

Permalink
Final version
Browse files Browse the repository at this point in the history
  • Loading branch information
vllur committed Feb 4, 2018
1 parent 3dc7f90 commit d2a4c93
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 118 deletions.
Binary file modified Project1.exe
Binary file not shown.
Binary file modified Project1.obj
Binary file not shown.
Binary file modified Project1.tds
Binary file not shown.
56 changes: 17 additions & 39 deletions Unit1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <fstream>
#include "Unit1.h"
#include <iostream>
#include <sstream>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Expand Down Expand Up @@ -52,7 +53,16 @@ void __fastcall TClickBot::HotKey(TMessage &Msg)

void __fastcall TClickBot::Button1Click(TObject *Sender)
{
Timer1->Enabled=true;
if(t_cur.size()<=0)
{
Application->MessageBox("Please first add points to the queue by pressing PgDn!",
"ClickBot",
MB_OK | MB_ICONQUESTION);
}
else
{
Timer1->Enabled=true;
}
}
//---------------------------------------------------------------------------
void __fastcall TClickBot::Button2Click(TObject *Sender)
Expand Down Expand Up @@ -102,7 +112,7 @@ void __fastcall TClickBot::FormCreate(TObject *Sender)
{
RegisterHotKey(ClickBot->Handle, 1, 0, VK_PRIOR);
RegisterHotKey(ClickBot->Handle, 2, 0, VK_NEXT);
t_cur.push_back();
t_cur.erase(t_cur.begin(),t_cur.end());
}
//---------------------------------------------------------------------------

Expand Down Expand Up @@ -155,48 +165,16 @@ void __fastcall TClickBot::Button7Click(TObject *Sender)
}
//---------------------------------------------------------------------------

void __fastcall TClickBot::WebsiteClick(TObject *Sender)
void __fastcall TClickBot::Howtouse1Click(TObject *Sender)
{
ShellExecute(0, 0, "https://vellurpatrick.github.io", 0, 0 , SW_SHOW );
//test for site opening
; //here will be a link to the project help site
//ShellExecute(0, 0, "LINK", 0, 0 , SW_SHOW );
}
//---------------------------------------------------------------------------



void __fastcall TClickBot::Savestepstotxtfile1Click(TObject *Sender)
{

std::fstream filesave;

if(SaveDialog1->Execute())
{
std::fstream plik;
plik.open( "steps.txt", std::ios::out );

for(int i=0; i<+t_char.size(); i++)
{ //std::vector<String> t_char;

plik << t_char[i];

}

if(filesave == NULL)
{
ShowMessage("There was an error with saving the file!");
return;
}
plik.close();
}


}
//-----------------------------------9----------------------------------------


void __fastcall TClickBot::Loadstepsfromtxtfile1Click(TObject *Sender)
void __fastcall TClickBot::Mywebsite1Click(TObject *Sender)
{
;
ShellExecute(0, 0, "https://uw423.mikr.us", 0, 0 , SW_SHOW );
}
//---------------------------------------------------------------------------

17 changes: 4 additions & 13 deletions Unit1.dfm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object ClickBot: TClickBot
Left = 1331
Top = 173
Left = 1451
Top = 220
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'ClickBot'
Expand Down Expand Up @@ -161,27 +161,18 @@ object ClickBot: TClickBot
object MainMenu1: TMainMenu
Left = 88
Top = 112
object File1: TMenuItem
Caption = 'File'
object Savestepstotxtfile1: TMenuItem
Caption = 'Save steps to .txt file'
OnClick = Savestepstotxtfile1Click
end
object Loadstepsfromtxtfile1: TMenuItem
Caption = 'Load steps from .txt file'
OnClick = Loadstepsfromtxtfile1Click
end
end
object Help1: TMenuItem
Caption = 'Help'
object Aboutauthor1: TMenuItem
Caption = 'About author'
object Mywebsite1: TMenuItem
Caption = 'My website'
OnClick = Mywebsite1Click
end
end
object Howtouse1: TMenuItem
Caption = 'How to use'
OnClick = Howtouse1Click
end
end
end
Expand Down
10 changes: 3 additions & 7 deletions Unit1.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@ class TClickBot : public TForm
TButton *Button6;
TButton *Button7;
TMainMenu *MainMenu1;
TMenuItem *File1;
TMenuItem *Savestepstotxtfile1;
TMenuItem *Loadstepsfromtxtfile1;
TMenuItem *Help1;
TMenuItem *Aboutauthor1;
TMenuItem *Mywebsite1;
TMenuItem *Howtouse1;
TOpenDialog *OpenDialog1;
TSaveDialog *SaveDialog1;
TMenuItem *Help1;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall Timer1Timer(TObject *Sender);
Expand All @@ -56,9 +53,8 @@ class TClickBot : public TForm
void __fastcall Button11Click(TObject *Sender);
void __fastcall Button6Click(TObject *Sender);
void __fastcall Button7Click(TObject *Sender);
void __fastcall WebsiteClick(TObject *Sender);
void __fastcall Savestepstotxtfile1Click(TObject *Sender);
void __fastcall Loadstepsfromtxtfile1Click(TObject *Sender);
void __fastcall Howtouse1Click(TObject *Sender);
void __fastcall Mywebsite1Click(TObject *Sender);
private:
void __fastcall HotKey(TMessage &Msg);
public:
Expand Down
Binary file modified Unit1.obj
Binary file not shown.
56 changes: 17 additions & 39 deletions Unit1.~cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <fstream>
#include "Unit1.h"
#include <iostream>
#include <sstream>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Expand Down Expand Up @@ -52,7 +53,16 @@ void __fastcall TClickBot::HotKey(TMessage &Msg)

void __fastcall TClickBot::Button1Click(TObject *Sender)
{
Timer1->Enabled=true;
if(t_cur.size()<=0)
{
Application->MessageBox("Please first add points to the queue by pressing PgDn!",
"ClickBot",
MB_OK | MB_ICONQUESTION);
}
else
{
Timer1->Enabled=true;
}
}
//---------------------------------------------------------------------------
void __fastcall TClickBot::Button2Click(TObject *Sender)
Expand Down Expand Up @@ -102,7 +112,7 @@ void __fastcall TClickBot::FormCreate(TObject *Sender)
{
RegisterHotKey(ClickBot->Handle, 1, 0, VK_PRIOR);
RegisterHotKey(ClickBot->Handle, 2, 0, VK_NEXT);
t_cur.push_back();
t_cur.erase(t_cur.begin(),t_cur.end());
}
//---------------------------------------------------------------------------

Expand Down Expand Up @@ -155,48 +165,16 @@ void __fastcall TClickBot::Button7Click(TObject *Sender)
}
//---------------------------------------------------------------------------

void __fastcall TClickBot::WebsiteClick(TObject *Sender)
void __fastcall TClickBot::Howtouse1Click(TObject *Sender)
{
ShellExecute(0, 0, "https://vellurpatrick.github.io", 0, 0 , SW_SHOW );
//test for site opening
; //here will be a link to the project help site
//ShellExecute(0, 0, "LINK", 0, 0 , SW_SHOW );
}
//---------------------------------------------------------------------------



void __fastcall TClickBot::Savestepstotxtfile1Click(TObject *Sender)
{

std::fstream filesave;

if(SaveDialog1->Execute())
{
std::fstream plik;
plik.open( "steps.txt", std::ios::out );

for(int i=0; i<+t_char.size(); i++)
{ //std::vector<String> t_char;

plik << t_char[i];

}

if(filesave == NULL)
{
ShowMessage("There was an error with saving the file!");
return;
}
plik.close();
}


}
//-----------------------------------9----------------------------------------


void __fastcall TClickBot::Loadstepsfromtxtfile1Click(TObject *Sender)
void __fastcall TClickBot::Mywebsite1Click(TObject *Sender)
{
;
ShellExecute(0, 0, "https://uw423.mikr.us", 0, 0 , SW_SHOW );
}
//---------------------------------------------------------------------------

17 changes: 4 additions & 13 deletions Unit1.~dfm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object ClickBot: TClickBot
Left = 1331
Top = 173
Left = 1451
Top = 220
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'ClickBot'
Expand Down Expand Up @@ -161,27 +161,18 @@ object ClickBot: TClickBot
object MainMenu1: TMainMenu
Left = 88
Top = 112
object File1: TMenuItem
Caption = 'File'
object Savestepstotxtfile1: TMenuItem
Caption = 'Save steps to .txt file'
OnClick = Savestepstotxtfile1Click
end
object Loadstepsfromtxtfile1: TMenuItem
Caption = 'Load steps from .txt file'
OnClick = Loadstepsfromtxtfile1Click
end
end
object Help1: TMenuItem
Caption = 'Help'
object Aboutauthor1: TMenuItem
Caption = 'About author'
object Mywebsite1: TMenuItem
Caption = 'My website'
OnClick = Mywebsite1Click
end
end
object Howtouse1: TMenuItem
Caption = 'How to use'
OnClick = Howtouse1Click
end
end
end
Expand Down
10 changes: 3 additions & 7 deletions Unit1.~h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@ __published: // IDE-managed Components
TButton *Button6;
TButton *Button7;
TMainMenu *MainMenu1;
TMenuItem *File1;
TMenuItem *Savestepstotxtfile1;
TMenuItem *Loadstepsfromtxtfile1;
TMenuItem *Help1;
TMenuItem *Aboutauthor1;
TMenuItem *Mywebsite1;
TMenuItem *Howtouse1;
TOpenDialog *OpenDialog1;
TSaveDialog *SaveDialog1;
TMenuItem *Help1;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall Timer1Timer(TObject *Sender);
Expand All @@ -56,9 +53,8 @@ __published: // IDE-managed Components
void __fastcall Button11Click(TObject *Sender);
void __fastcall Button6Click(TObject *Sender);
void __fastcall Button7Click(TObject *Sender);
void __fastcall WebsiteClick(TObject *Sender);
void __fastcall Savestepstotxtfile1Click(TObject *Sender);
void __fastcall Loadstepsfromtxtfile1Click(TObject *Sender);
void __fastcall Howtouse1Click(TObject *Sender);
void __fastcall Mywebsite1Click(TObject *Sender);
private:
void __fastcall HotKey(TMessage &Msg);
public:
Expand Down

0 comments on commit d2a4c93

Please sign in to comment.