Read Mode
Default

How to make Clickable Buttons on CMD | Button Function | By Kvc

Making a Button Layout on CMD Console | Button Function v.1.0 | By Kvc
Making a Button Layout on CMD Console | Button Function v.1.0 | By Kvc
Hello There! It's very difficult to take time out for the thing you love, when Life makes everything difficult for you. But, Here we are again... Taking out some time for the thing we love. And In this Article, We'll talk about a Question asked to us via Email Lego StopPro, about making a tutorial on Using the Button Function v.1.0 | By Kvc. So, Today in this article, we're going to talk about How to make Clickable Buttons on CMD?

How to make Clickable Buttons on CMD ?

As all of Us know one thing that CMD is a CUI based Command line interpreter. In Simple words, It takes one line as a command then execute it in the system. Then it reads next line of command and so on. And if anyone of you know that in the First Microsoft OS, which is also known as DOS. We need to give commands from Keyboard and No mouse interface was there in the history books. But, Somehow Microsoft manages to Make that Scary CUI (Character user interface) into GUI (Graphical User Interface).

With this kind of techniques, we are following their footsteps in making the CUI into GUI. We'll use the amazing Button Function v.1.0 | By Kvc for this purpose. So, Lets talk about How the Button Function Works? and what are its requirements?

How Button Function works?

The Button Function Ver.1.0 is created By Kvc. It is 3.39 KBs of Batch Function, which takes 5 parameters to Generate a code for the Button. Please Note that, Button Function is dependent upon the Batbox.exe - An Awesome Batch Plugin | By Darkbatcher. So, Cannot use this function without placing the Batbox.exe file along with the Button Function in the same folder.

We want to clarify one thing that Button function is not responsible for printing the button layout on the cmd console or making them clickable. It only generates the code for printing a Button, and saves that code to corresponding variable which we'll have to provide in one of the 5 parameters it takes.

You can Generate code for as many buttons as you want, all in once. And they all will be saved in the corresponding variable names that you'll provide to the function. So, It becomes very Clean and simple to use this function, even if you want to print multiple buttons on the CMD console.

Syntax to Use Button Function:

The Button Function can take infinite number of parameters. But, to print a button on the console window, you need to provide at-least 5 parameters to the function. Lets talk about these parameters in detail.


How to make Clickable Buttons on CMD
Help Menu Of Button Function | v.1.0 | By Kvc
Call Button "[Name]" [Color] [Var] [Y|N] [Type]


[Name] : Name of the Button / Button Text to be displayed. e.g. "Click Me"
[Color] : Color code of the button. BG and FG color of the Button on CMD.
[variable] : Function returns the code of the button which will be executed by Batbox.exe ...
[Y|N] : Will enable or disable The gradient on the button... Shadow Effect!
[Type] : It can only take 1,2,3 as its values... And it defines the Border Type of your buttons.

Note: You need to use the Call command in order to use all of Our Batch Functions, otherwise your program may give unwanted outputs in run-time. And you can also provide parameters for the next Button in the same line of the code. Keep on providing parameters for the next buttons, until you reach your desired goal of buttons to be printed. Once you're done with all the parameters, press Enter. And voila! Nothing happens.

How to make Clickable Buttons on CMD
Table to Show All types of buttons, Function can generate | Made in BPaints
This is due to reason that, Button function has generated the code for all those buttons. But saved them into their corresponding variables. You can check all those variable by simply writing Set in the CMD (without and parameter). To Utilize these codes as buttons you need to Use the Batbox.exe batch extension. 

Combining Batbox And Button Function

As in the image above in the title of the article shows a simple button on the CMD, which says "Try to Click me". And you'll notice a small line of code written at the top left corner which calls batbox and thus printed the button to a specified location. Hence, only using the batbox.exe will make it appear on CMD and clickable at the same time.

Display the Button on CMD:

Batbox /o [X] [Y] %Var% /o [X2] [Y2] %Var2% ...

Where, X and Y are the co-ordinates,where you want to print the button. And using this information of position, We can check the location where user has clicked. And if it falls in the region of the button, then we'll perform the specific action according to the functioning of the button in the program. The following image contains code, which We are using to check this in programs.

Making Them clickable:
How to make Clickable Buttons on CMD
Code Preview of Hotspot Creator V.2.0 | By Kvc
In the Above code. We're using the If Command in order to Check the area under which button and the User's Mouse click got intersect. Now, We think you got the idea of How to make Clickable Buttons on CMD?

Conclusion

In The End, We just wanna conclude that making a GUI application in Batch is not an Easy Nut to crack. We need to implement multiple techniques to achieve our goal. But in the final output, A beautifully designed program looks so much pretty, than a solidly coded program. That's why, We prefer making functions and reducing the mess in the main code, as well as decreasing the Headache of the Programmer. And he can concentrate his energy in a better design of the program in looks.

Download link is at the Bottom of the Article.

Related Posts: #TheBATeam has created some Beautiful programs using this Awesome Button Function. You can click on corrsponding link to have a Look at them. You can find source code of these Batch projects at the bottom of These articles.

Hotspot Creator v.2.0 | By Kvc
Hotspot Creator v.2.0 | By Kvc

Simple, but effective in turning Your laptop into a perfect wifi hotspot. Share your internet with your friends, relatives etc. Give it a Try.





Easy Fix to All of your problems with the annoying shortcut Virus. It can remove Shortcut virus from the Infected USB device, as well as from your PC. Select the required option in order to apply the actions either on System or a specific Drive. 




A Simple and Beautiful batch program. Just intend to do a required piece of work. But, It is only of 6 KBs of main program code. But uses a lot of plugins. You can view its source code and use ti for your personal purpose too.


We would like to read your reactions through your comments. If you like our work, please Follow us from the right sidebar button. Thanks for your interest and time.

Keep Learning, Keep Sharing...
Be Happy, Spread Happiness...

Download Link: 😎

#TheBATeam

11 comments:

  1. Wow, Awesome plugin, I have used it in many of my Batch programs, Great Work :)

    ReplyDelete
  2. I want the code. PLEASEEE!!
    I hate using code that I didnt write myself. I want to understand everything my program does.

    ReplyDelete
    Replies
    1. What do you mean? The code is already there as the function is a Batch File. Please specify your problem correctly

      PaperTronics,
      TheBATeam

      Delete
    2. Do you mean the batbox.exe code?

      Delete
    3. @Lego StopPro I don't think he means Batbox's code as he can find it easily on batch.xoo.it

      Delete
    4. @PaperTronics Thanks. Thats just what I ment.

      Delete
    5. @PaperTronics but that site is italian. help. :D

      Delete
    6. This comment has been removed by the author.

      Delete
  3. @blackey eni The site is in French but you can easily translate it using your web browser. Although I would highly recommend using the button function v2.0 since it's more efficient and it produces buttons with mouse hover enabled

    ReplyDelete
    Replies
    1. Thx. But I want to understand what my code does.

      Delete
    2. Hi, eni!
      We are glad to have you here. And, You can use the Button function 2.0 without any hesitation. And, the desire to understand the code first - is a great one! And, As you know all the Batch Functions we are creating here in TheBATeam are to help Others in reaching their goals easily.

      And, as the Functions are simple Batch Files - You can easily edit or read them before using in your programs. Just Download any of the Function and Analyze its working by your own. And, Then You can use them to innovate Batch Programing to another level.

      Thanks for your time. Happy Coding!
      #TheBATeam

      Delete

Powered by Blogger.