How To Write An Interface

Table of contents:

How To Write An Interface
How To Write An Interface

Video: How To Write An Interface

Video: How To Write An Interface
Video: Java Interface Tutorial - Learn Interfaces in Java 2024, November
Anonim

Computer programs can be created in the console version or with the gui interface familiar to Windows users. The program interface can be written completely independently, but it is much easier to create it in a particular programming environment using visual components.

How to write an interface
How to write an interface

Necessary

Borland C ++ Builder or Borland Delphi programming environment

Instructions

Step 1

The easiest way to create a program interface is using the Borland programming environment. Depending on the language used, it can be Borland C ++ Builder or Borland Delphi. Both programming environments are very similar and differ only in the language used.

Step 2

Install and run the programming environment. The program window will open, in it you will see a gray rectangle. This is a form designer window, and it is simpler to prepare the interface for your future program, it is designated as Form1. By clicking on the title of the form, in the left part of the program, in the object inspector window, you can give it the desired name. In this case, you will need to enter the name of the program in the Caption line.

Step 3

Determine the size of the window of the future program, to do this, just drag the shape with the mouse. Since you have already started creating the program interface, it means that you have a well thought-out algorithm for its operation and you know what elements should be included in the interface. For example, you need a button. In the upper part of the programming environment window, find the line with visual components, in it select the Standard tab. Find the image of the button on it (it says OK) and just drag it onto the form.

Step 4

Place the button where you want it on the form. Resize it if necessary. Now give the button a name - for example, Open. To do this, click the button with the mouse and in the object inspector window enter the name of the button - Open in the Caption line.

Step 5

Likewise, you can drag and drop other interface elements you need onto the form - windows for text input and output, panels for images, decorative frames, radio buttons, drop-down lists, etc. etc. You can customize each element dragged onto the form in the way you want. You can move the group of elements located on it in the form by selecting them with the mouse. This is convenient when you need to move a little, for example, several buttons at once.

Step 6

There are a number of components that you will often use, that is, drag and drop onto the form, but which will not appear in the finished running program window. For example, drag the Open Dialog and Save Dialog components from the Dialogs tab. Place them somewhere at the bottom of the window so they don't get in the way. With the help of these components, we will be able to implement the procedure for opening files and saving them. There are many similar components, you will use them often.

Step 7

After the program interface is created, you just have to fill it with life - that is, enter the necessary lines into the code editor window. After that, the interface of your program will begin to respond to user actions. You can read more about working with Borland programs in the relevant literature.

Recommended: