You can see my first Design tutorial here.
link:://rouletteforum.cc/coding-for-roulette/tom%27s-second-rss-pro-tutorial-(design)/ (link:://rouletteforum.cc/coding-for-roulette/tom%27s-second-rss-pro-tutorial-(design)/)
And for V3 of the bot.
link:://rouletteforum.cc/coding-for-roulette/tom%27s-rss-pro-tutorial-v3-(design)/ (link:://rouletteforum.cc/coding-for-roulette/tom%27s-rss-pro-tutorial-v3-(design)/)
I wanted to start a new thread.
And go through a complete Design Tutorial.
Doing some very extensive stuff.
Most of the basics was covered in
link:://rouletteforum.cc/coding-for-roulette/tom%27s-second-rss-pro-tutorial-(design)/ (link:://rouletteforum.cc/coding-for-roulette/tom%27s-second-rss-pro-tutorial-(design)/)
However, it was not extensive enough.
So if I cover the same ground again.
Please excuse me.
As I wanted this to be a much more fuller article
on many of the design elements.
So here goes.
An In Depth Look into Design.
-------------------------------------
Experimentation is the key to Creation.
Let's get started with the humble form.
The FORM...
--------------
Here is a list of all the things you can change on your humble form.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/formlist.jpg)
I'd recommend spending some time with the form.
And looking at the features. Try each one out.
See what affect it has on the way the form looks.
For this bot.
We are going to change the style.
To bsSingle.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/style.jpg)
And we are also going to remove the minimise and maximise.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/bordericons.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/bordericons1.jpg)
Then we change the caption of the form.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/caption.jpg)
To change the size of the form.
You can use the mouse to drag it to the size you wish.
Or type in the size to be more exact.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/hw.jpg)
Changing the font of the form will affect everything you put on it.
So keep that in mind. However, you can change the objects fonts as well.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/font.jpg)
Then there is the amount of Events you can chose from.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/formevents.jpg)
You could say, that the form.
Is your canvas. And you are about to paint on it.
All the above will set it up. To do just that.
Ohh, I almost forgot about the color.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/color.jpg)
Now we have done the form.
We move onto the design and look of the form.
We do this by putting things on it.
Memos, Buttons, etc.
To make it look even better.
We add in some flair.
To do this we add in
Bevels.
-------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/bevel.jpg)
And you can change many of the aspects of the Bevel.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/bevel_opt.jpg)
Plus the Bevel has no Events that you have to worry about.
Here are two Bevelled boxes one lowered(Standard) and the other Raised.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/bevel_lr.jpg)
Labels
--------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/label.jpg)
Adding Labels is fairly straight forward.
Just select TLable from the right hand side.
And just plonk one down.
You can modify the labels.
Change the color, the font and text.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/label_prop.jpg)
Labels also have events that can be accessed.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/label_events.jpg)
Most of the time you wont have to worry about using any events.
Since Labels are just that.
LABELS...
They are primary used to describe something.
The Panel...
--------------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/panel.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/panel_but.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/panel_prop.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/panel_events.jpg)
Panels are very useful.
You can write things to them.
You can use em in all sorts of ways.
You may not need to Double click on panels.
However, sometimes when you run the program.
Or compile it.
And you press the panel.
It may come up with an error message.
So it would probably be better just to double click on it.
And it will add in an event to the script.
procedure Panel1Click(Sender: TObject);
begin
end;
The Edit Fields...
--------------------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/edit.jpg)
In this picture.
We can see 4 edit boxes.
The edit fields, can have different background colors.
And fonts, with font colors.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/edit_boxes.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/edit_prop.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/edit_events.jpg)
You can also make the edit boxes Read Only.
So you cant type in them.
The Memo...
--------------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/memo.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/memo_box.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/memo_change.jpg)
Post it notes.
Use a memo...
Another useful object.
Again, you can change many of the features for the memo.
Just plug away, on the left hand side.
And see what each option does to the memo.
The Button...
--------------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/button.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/click.jpg)
What can I say about these things?
Hmmm?
Well, there buttons.
What else needs to be said?
You press em.
Then they do something.
What more do ya want?
--------------------------
More to come.
Check Box and Radio Buttons
------------------------------------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/cbrb.jpg)
This is the open state. Or the state it starts at when you run it.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/cbrb1.jpg)
This is with both states selected.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/cbrb2.jpg)
Here you see that both the check boxes are but only one radio button on.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/cbrb3.jpg)
Check Boxes and Radio buttons are basically the same.
However, only one Radio button will be on at any given time.
So if you select one.
Then select another.
The first one turns of.
Pictures this...
------------------
Gosh I had no idea how to do this.
When I saw this, from one of the MMM forum members. (Alfolof)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/image1.jpg)
I had no idea how to add in a picture.
So I did an internet search.
Then I asked Alfolof, and he showed me how easy it was.
My search on the internet showed me one way to do it.
And Alfolof showed me the easy way to do it.
So, let me show you the easy way first.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/image0.jpg)
Here is the first picture we are going to use.
logo_skull_bones.jpg
(link:://:.therightperspective.org/wp-content/uploads/2009/02/logo_skull_bones.jpg)
And this is the second picture we will use.
ocean.bmp
(link:://aubedesheros.net/resources/adh/resources/ocean.bmp)
------------------------------
Place the Image object onto the form.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/image2.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/image3.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/loadpic.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/skull1.jpg)
This is what it looks like on the form.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/autosize.jpg)
This is what it looks like when you use AutoSize.
With the form re sized to make it fit.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/form_resize.jpg)
You can add events to pictures if you wish.
And/or change the properties.
Now lets look at a different way to put a picture in the window.
This time we will be putting a background picture on the form.
To do this.
You can only use .bmp of bitmap pictures.
"How to add a background picture to your form"
---------------------------------------
I found out how to do this by accident.
I trolling through google.
Looking for ways to add pictures to forms.
And found some info on bitmaps.
First we make some variables.
var
MyBitmap: TBitmap;
Then we add this to the creat procedure.
procedure Form2Create(Sender: TObject);
begin
MyBitmap:=TBitmap.Create;
MyBitmap.LoadFromFile('c:\ocean.bmp');
Brush.Bitmap:=MyBitmap;
end;
You can see here that I have moved the ocean.bmp to my c: directory.
Just so I know where it is. Makes it easy to locate.
And this is what it ends up looking like.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/form_pick_bk.jpg)
The .bmp image is tiled onto the background of the form.
Now the only thing I am unsure of.
Is when you compile the program.
If you still need to have the .bmp in your c: drive
Or if it will compile the picture into the program.
I guess you could always load the .bmp into the code.
And access it from there. But I am not sure how.
Here is a list of options you can use with bitmaps.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/bitmap_opt.jpg)
What's on the Menu?
------------------------------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/menu.jpg)
Place the menu object on the screen.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/menu_form.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/menu_ed.jpg)
Add a Menu Item.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/menu_add.jpg)
Change the names of the menu items.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/menu_names.jpg)
And this is what the menu looks like.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/menu_res.jpg)
There is only 1 event with the Menu.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/menu_event.jpg)
So when you double click on the event.
This is the code.
procedure MainMenu1Change(Sender: TObject; Source: TMenuItem; Rebuild: Boolean);
begin
end;
In between begin and end.
Is where you write your code.
---------------------------------
Place your order now...
Combo Boxes
--------------------------------------
Most of this info can be found here.
link:://rouletteforum.cc/coding-for-roulette/tom%27s-first-rss-pro-tutorial/ (link:://rouletteforum.cc/coding-for-roulette/tom%27s-first-rss-pro-tutorial/)
But since I want to keep the flow of this tutorial on the go.
I will repost much of what is mentioned there.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/combobox.jpg)
A combo box
Edit the text for the combo box.
Here I put in Casinos.
As we are going to add a list of casinos to chose from.
(link:://rouletteprofesor.com/rss-pro/07.jpg)
Change the caption of the combo box.
(link:://rouletteprofesor.com/rss-pro/08.jpg)
Adding in entries to the combo box.
(link:://rouletteprofesor.com/rss-pro/12.jpg)
We add these Items to the menu.
Chose a casino.
EuroGrand
bet365casino
Casino Tropez
Mapau
21Nova
William Hill
(link:://rouletteprofesor.com/rss-pro/13.jpg)
Run the script.
(link:://rouletteprofesor.com/rss-pro/14.jpg)
And press on the menu to see the list of Casinos.
Now we add some action to the menu.
So when you select the casino.
It will chose that casino to play at.
Double click on the combo box (Menu)
And this will take you to the Script area.
This is what the code looks like.
procedure ComboBox1Change(Sender: TObject);
begin
end;
Now put something inside it.
procedure ComboBox1Change(Sender: TObject);
begin
case ComboBox1.ItemIndex of
0:ShowMessage('Choose a casino');
1:set_roulette_window_name('European Roulette - EuroGrand Casino');
2:set_roulette_window_name('European Roulette - bet365casino');
3:set_roulette_window_name('European Roulette - Casino Tropez');
4:set_roulette_window_name('European Roulette - Mapau Casino');
5:set_roulette_window_name('Roulette Pro - 21Nova Casino');
6:set_roulette_window_name('European Roulette - William Hill CASINO CLUB');
end;
end;
Ok, Run it again.
And go to the menu.
This is what happens when you select one of the menu items.
(link:://rouletteprofesor.com/rss-pro/15.jpg)
(link:://rouletteprofesor.com/rss-pro/16.jpg)
Dialog: Lets Talk...
-------------------------
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/dialog.jpg)
The amount of time I tried to find out how to load and save files.
Ohh my gosh... I was looking everywhere.
I was about to use the old way.
And use InputQuerry from RSS.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/input.jpg)
And this is the code that brings it up.
procedure Button3Click(Sender: TObject);
var d;
begin
d:='c:\rss-data';
InputQuery('Casino Config Question','Open Casino Config?',d);
end;
That just was not good enough.
I wanted the regular open and save requester.
Hmmm,
So frustrating trying to figure this stuff out.
When you get no assistance.
Looked on google.
No go.
Looked for help with Delphi.
Still no go.
Frak...
Was not getting anywhere.
Then I noticed the Dialog objects.
Hmmm....
Maybe these do something?
But how do I use em?
I kept getting errors, like this.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/error1.jpg)
Ohh man...
Drove me nuts...
Anyway...
I finally figured it out.
And managed to get it to work.
So here is...
Dialog: Lets Talk...
-------------------------
How to add in Open and Save Dialog box and get them to work.
For this example.
Lets keep it as simple as possible.
Lets make a simple form.
Like this.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/openclose.jpg)
It has two buttons on it.
"Load File"
"Save File"
It has two Dialog objects on it.
OpenDialog
SaveDialog
And it has a simple Panel on it.
Where we will display the results.
Now double click on each button.
So we can have something to write code in.
procedure Button1Click(Sender: TObject);{Load Button}
begin
end;
procedure Button2Click(Sender: TObject);{Save Button}
begin
end;
Do the same for the two Dialog boxes. Open and Save.
procedure OpenDialog1CanClose(Sender: TObject; var CanClose: Boolean);
begin
end;
procedure SaveDialog1CanClose(Sender: TObject; var CanClose: Boolean);
begin
end;
So far, easy...
Now you will be surprised as I was at how easy this is.
First lets open a file.
And send the file name to the panel.
So you can see what it is you opened.
procedure Button1Click(Sender: TObject);
begin
OpenDialog1.Execute(false);
Panel1.Caption:=OpenDialog1.FileName;
end;
Man, you have no idea. How many times I had to go about doing this.
First I tried
OpenDialog1.Execute then
But that only gave me the error message.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/error1.jpg)
So it needed a parameter?
What kind?
And how?
What kind of parameter?
I tried the basics.
true/false
OpenDialog1.Execute(True);
Did nothing.
What???
OpenDialog1.Execute(false);
Ohh my god...
I got the dam requester to open up.
Yippee... what a re-leaf.
Hey, if that part works.
Perhaps I can save a file as well.
procedure Button2Click(Sender: TObject);
begin
SaveDialog1.Execute(false);
Panel1.Caption:=SaveDialog1.FileName;
end;
So here are some pictures that explain what happens.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/open_req.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/open_res.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/save_req.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/open_res.jpg)
There it is...
Done and dusted.
There are other Dialog boxes you can add in as well.
I may go into them at some later stage if I need em.
Ok here is a list of all the objects that are in RSS Pro.
Delphi 7 and Delphi 10 may have more.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/standard.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/add.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/win32.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/dialogs.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/data.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/datacontrol.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/ado.jpg)
For the most part.
I have no idea what most of these do.
I have covered the ones that I have used myself.
And found out how to use them.
Some of these may be covered in an advanced Design tutorial.
But that may come much later.
What's in a Name?
--------------------------
When you have lots of Buttons and fields.
It is easy to get lost.
Since they are all similar.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/name.jpg)
procedure Button1Click(Sender: TObject);
begin
end;
Button1 is the name of the object.
When you have a lot of objects on your form.
I can get a little confusing as to what does what?
You could add comments to the end of the code like this.
procedure Button1Click(Sender: TObject);{Load Button}
begin
end;
Or you could name your object.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/name2.jpg)
Double click on it, to get this code.
procedure loadClick(Sender: TObject);
begin
end;
You can see that now we have loadClick.
As the name of the object and it's procedure.
Just something to consider when designing your applications.
PUTTING IT ALL TOGETHER..
--------------------------------------
Now that I have gone through many of the components.
It is time to put it all together.
And make our application.
We will be creating our Bot. Or application.
Using many, if not all, of the things I have mentioned in this In Depth Design Tutorial.
So for those interested.
You can follow along.
------------------------
Ok, Lets get going.
First we make our form.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/01.jpg)
Give it some flair with Bevelled boxes.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/02.jpg)
Now we start adding our objects.
Memos objects for Black Numbers, Zero Numbers and Red numbers.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/03.jpg)
All the Bevelled boxes for the design.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/04.jpg)
With all the buttons, edit fields, labels and box buttons,
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/05.jpg)
Now to add in the Menu.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/06.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/07.jpg)
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/08.jpg)
Here is the complete Bot Interface.
(link:://rouletteprofesor.com/rss-pro/my_bot_v3/09.jpg)
Now all I got to do.
Is code it.
That will be my next article.
Tom's RSS Pro: Tutorial V3 (Code) In Depth
I have attached the finished design for you to look at.
All of the above Tutorial can also be made in Delphi 7 and 10.
(link:://i394.photobucket.com/albums/pp29/Anjos007/Delphi7.jpg)
Thanks so much for letting me go on.
I hope you have learned something.
I think you find this a very good resource for your applications.
I am sure that it may even assist you in creating your very own applications.
Thanks...
Yours...
Thomas R. Grant
Wow Thomas, now THIS is a good tutorial.
You should be like: [attachimg=#] after all of this.
Be certain the forum thanks you for your efforts and great contributions. You may be forming new generations of coders, in the times to come.
May your tutorials become a reference "corner stone" for those who are interested in "sitting on the coding chair".
Regards and many thanks! :thumbsup:
Thanks Victor.
You think that was hard and arduous.
Wait till you see the next one on coding the bot.
---------------------------------------------------
I hope other members find what is in these tutorials of interest.
Perhaps, as you say.
It may bring in a few extra people that may be interested in coding.
Well Thomas, the roulette community is always short on coders. Most of it due to programmers "being made" in another communities. Perhaps the endogenous programming tutorials and the ease of programming of modern tools can replenish the roulette community of willing programmers.
I know by your tutorials you are an active part for achieving that.
Your tutes sure are worth archiving :thumbsup:
Only thing left now.
Is for a few other members to follow along.
And send in there efforts.
Design is easy.
Code can be the difficult part.
But I will attempt to explain it as good as I can.
Or as good as I know how.
As I mentioned earlier.
All of the above design can be done in Delphi 4, 5, 6, 7 and 10.
I also created this Tutorial as a reference point for my self.
So I can go back to it from time to time.
To see what I may have forgotten.