Creating a graphical user interface using the Win32 API. Shell. This is a special class designed to interact with the window manager. widget from this class can have only one child. The Shell class contains subclasses. XmFrame. Volume

When developing application programs, it seems useful to create GUI. In fact, this is the creation of an environment for calculating problems of a certain class without programming on the part of the user. As a rule, it makes sense to develop such interfaces for problems with several parameters if similar problems are expected to be solved repeatedly. In this case, it is advisable to develop a graphical interface that helps the user obtain the results of solving the problem (usually in graphically) for a certain choice of parameters. Such an interface can also be convenient when creating educational tasks, because in this case the student spends the main attention not on programming or solving the problem, but on selecting the required parameters, analyzing and comprehending the resulting results.

From the above brief introduction It is clear that the mandatory elements of a graphical interface when solving scientific and/or educational problems should be:

1. One or more windows for displaying graphical calculation results.

2. Several editable windows with which you can set and/or change the values ​​of task parameters.

3. Control buttons that allow you to start and stop the calculation process, redraw the results, and exit the task.

4. Explanatory notes (static text).

Of course, other controls are possible, such as scrollable lists, radio buttons for selecting one of many options, etc., but in this tutorial we will look in detail only at the four types listed. Figure 8 shows simplest interface, created to study the beats formed when two harmonic vibrations with close frequencies. As can be seen from the figure, all of the above elements are present in it.

To create such an interface, you can use the graphical output functions, as well as special function, designed for interactive interaction user with a picture. This function is called uicontrol. But to simplify the work and create similar interface elements, the MATLAB system has special program, which allows at the level visual programming, create the required elements almost without writing code.

Rice. 8. The simplest graphical user interface for solving the “Beat” problem

9.1. Creating the appearance of the interface

In this section, we will look at using MATLAB to develop the appearance of a graphical interface (GUI -GraphicsUserInterface) using graphical (visual) programming tools. To call visual editor you need to type the command guide in the MATLAB command window. After a certain time, determined by the speed of your computer, two new windows will appear, shown in Fig. 9. One of them is the control panel ( Control Panel, in the figure on the left) and the shape or drawing area (Figure, in the figure on the right). These windows may overlap, but we have placed them side by side for clarity of presentation. The picture shown above will appear on the screen if there is no open picture before calling guide. If the guide function is called after drawing a picture, it is opened instead of an empty one. We will look at creating a graphical interface from the very beginning.

Before creating a GUI, it is advisable to “blueprint” what you want to have as an interface. We'll look at an example of outputting three different signals in three subwindows, which in graphical terms high level would be determined by the operators subplot(3,1,k), where k is the plot number. Besides,

Rice. 9. General form visual graphic editor and editing windows

to the right of the actual sills with graphs, we want to have three editable

Fields in which you can enter/edit numerical values three

variables. Let these variables take arbitrary values.

In this presentation, we will not equip our editable windows with checking

whether the entered values ​​satisfy any conditions, although this is possible

Can. Let's call these variables N, R, C. In in this example meaning calculation

current in the RC circuit when a signal with number N is applied to the terminals, and R and C are resistance

voltage and capacitance in the circuit ( detailed description tasks see paragraph 10 of the main

manual text).

Our interface should allow changing the values

values ​​of N, R, and C, obtaining in three located

subwindows one above the other signal (voltage,

supplied to the terminals), derivative of the signal

la and resistance voltage U r . Besides

windows for displaying graphs and editable windows

R u n E x i t

input must be placed on the interface panel

there are two more buttons - RUN - start the program on

Rice. 10. Interface view

account and EXIT - termination and deletion

graphics window.

At the first stage it is necessary to develop appearance interface. Let it be

According to our preliminary sketch, the interface should look approximately

as follows (Fig. 10). The elements of this interface are three windows

display of graphs (axes in terms of the control panel), three static inscriptions N, R, C (text), three windows for entering/editing data (edit) and two buttons (push).

To create subwindows in which the graphs will be displayed, use the button shown on the right in the figure (window and axes). By clicking on this element on the control panel and moving the mouse to the drawing panel, you need to place a cross, which will be on the tip of the mouse, while

the place where the left one should be top corner first subwindow. By pressing and holding the left mouse button, you need to drag out the resulting rectangle until required sizes. After this, the procedure for constructing the other two windows is repeated in a similar way.

To create editable input windows, use the edit button shown on the right. It is used in the same way as when creating sills with axes. First, a mouse appears loaded with a cross, with which an input rectangle is constructed.

Labels on the drawing panel are created using the text button, which is moved and aligned in the same way as described above. In order for some kind of text to appear inside the static text area

inscription, you need to work with the property editor, which is called either using the Property editor button, or using double click left mouse button on the corresponding object in the drawing panel.

To create and place buttons, use the panel labeled Push. The method of placing a button and selecting its size is completely the same as the method described above for the editing window and the static text window.

The output and editing windows, static text windows and buttons, as well as other objects constructed in this way can be aligned and certain spaces between them can be set using the alignment panel (Alignment Tools).

To do this, click on the corresponding button on the control panel, and the alignment panel will appear. To specify a number of objects with which any actions will be performed, you need to select them by clicking on each of them while holding down the Shift key. Selected objects are marked

black dots around the corresponding objects. If you need to change the size of any object (buttons, windows, etc.), you must click on this object with the left mouse button and use the mouse to change the required size in the same way as the size of any Windows window.

When working with graphic objects In the drawing panel, it is advisable to expand (using the corresponding Windows window button) the drawing panel to the full screen and select the size of all objects in the drawing panel.

Since by default the sizes of all objects are set in pixels, this can lead to the fact that when resizing the output window, buttons and/or windows may collide with each other. To avoid such an undesirable phenomenon, it is necessary to set the size units of all objects in dimensionless variables - fractions of the window size. This size is called normalized. To do this, you need to call the property editor by clicking on the button with the top button on the control panel.

by writing to Property editor. Having selected all the objects we entered in the upper window of the property editor (using the Ctrl key held down and selecting objects with the left mouse button), in the lower window of the property editor we find the Units property (units of measurement) and select it by clicking the left mouse button. After this, in the middle part of the editor, in a special window on the left, the Units property will appear, and on the right - a window for selecting values, in which there is a drop-down list with acceptable values properties. The Units property must be set to normalized . Similarly, you need to set the value of the FontUnits property – the units of font size. This ensures that the font size changes when the window size changes.

To place labels on buttons and in the static text area, you need to select the corresponding object (either by double-clicking directly in the drawing area, or in the upper window of the property editor) and in the lower window of the property editor, find the String property, and after selecting it, enter the required text between the quotes ( for example, 'Start' on the corresponding button). To set labels above each of the output windows, you need to select the corresponding window and call the property editor8, in the lower window of which you need to find the Title property.

8 The property editor can be called not only using the button on the control panel, but

and double click on the corresponding object.

DOCUMENT STRUCTURE

4.1. Visual Programming Technology

4.1.2. Main window Visual Studio

4.1.3. VS Main Menu and Toolbar

4.1.4. Visual Studio Panel Windows

4.1.5. Configuring VS IDE settings

4.1.6. Test tasks

4.1.7. Laboratory work on the topic “VS .NET Development Environment”

4.1. Visual Programming Technology
and basic concepts

Compared to previous generations of programming languages, the language high level programmingVisual Basic.Net (VB) has a number fundamental differences. This is a powerful, professional programming system that allows you to quickly and efficiently create applications for MS Windows . Since the system is « visual», a programmer can create a visible part of an MS Windows application , without writing almost a single line program code. This visible part is the basis of the user interface « software project - user », through which the user interacts with the software project. Development of both program code for classes and methods to solve the problem, and software interface applications are carried out on the principles object-oriented approach , implemented in Visual Studio .Net (VS) . Applications (projects) run under MS Windows using Integrated Development Environment (IDE).

For applications built with the IDE, characteristic feature is the existence on the screen at any given time of many objects: forms, windows, buttons, menus, text and dialog boxes, scroll bars, etc. The user has a certain (depending on the algorithm of the problem being solved) freedom of choice regarding the use of these objects. He can do click mouse button, drag an object, enter data into a window, etc. In most cases, there is no predetermined sequence of actions. Typically the developer software(Software), when creating a software project, should not limit the actions of the application user. He must develop software that adequately responds to any user action, even incorrect ones (in a good program there should be no unintended actions). Therefore, for each object on the screen there is a number of possible events. Some of them are made by the user: click or double click by clicking a mouse button, dragging an object, pressing a keyboard key, entering text into a window, etc. other events occur as a result of other events occurring: for example, a window opens or closes, a control becomes active (available) or becomes inactive. Moreover, each event manifests itself in certain actions(responses, reactions, behavior) of a software project. These actions can be divided into two groups.



The first is a consequence of the properties of the object. These properties are set by the software developer from some standard list of properties, given by the system programming and/or MS Windows itself . An example of such actions is minimizing a window after clicking a button Collapse. Change the behavior of an object in similar cases the programmer cannot. However, in many cases there is a certain possibility of varying the response of an object to an event (text, font, color, size, location on the screen, etc.) by setting certain properties.

The second group of actions (responses) to events is completely determined by the software developer. This is ensured by the ability to specify a VB procedure for each possible event. Initially, each such procedure is empty, without a procedure body, and therefore, when an event occurs, nothing happens. In theory, it is possible to create a procedure for any event, but in practice, the programmer fills in code only procedures for those events that are of interest.

Thus, VB provides the user with an object-oriented, event-based programming environment. Simply put, the process of developing a software project in this environment comes down to selecting a set of objects and their properties, setting events and procedures for processing them, and creating software to solve a problem, which together ensure the functioning of the application being created.

The main terms of visual programming, as mentioned above, are an object, form, property, class, event, procedure, method etc., which have the same meaning in any visual application development environment.

Object– this is a certain separate entity that differs from other entities by special properties, behavior, and interaction with other application objects. With an object-oriented approach, any application is a set of interconnected objects that implement the necessary functional requirements for the application. An object is always concrete and actually exists on a form (as controls) or in an application (as instances of classes).

The basic unit in object-oriented programming is a software object, which combines both the data that describes it (properties) and the means for processing this data (methods). That is, software objects have properties, can use methods, and respond to events.

The main objects of visual programming are the form and its controls.

Form ) is an object that represents a window on which controls are placed, for example, a Button (Button); Label (Label); Text field (TextBox); Checkbox (CheckBox); List (ListBox); Drop-down list (ComboBox); Switch (RadioButton)and etc .

The visual programming environment allows you to see objects on the screen at the application design stage and makes it possible to customize objects by changing their location, size and other properties. The form is container of objects, and at the same time itself is also an object. When placing an object on a form, the main parameters of the object are saved in the executable program code. In this case, objects are also program blocks or fragments of program code (classes, procedures, methods, modules) from which the project (application) being designed is “assembled”.

Object property is a value or characteristic stored by an object. At the same time, the set of properties of an object determines its state. For example, Text ( Text ) or Color ( BackColor ) forms, method Text alignment ( Alignment ) or Character color ( ForeColor ) text field are properties. In a program, an object is accessed by object name . Object properties can be set in the window Properties and change the properties of objects in the program code.

In the program code there are certain rules (a certain format) for setting the property − the object name and the property name according to the rules of dot notation are separated by a dot .

Class is a collection of objects that have common properties and behavior. For example, Button1( Button1 ) on Form1(Form1 ) with all its specific properties and action is an object of the class Button . The class is characterized by such fundamental concepts of object-oriented programming as:

· inheritance – a class object has all the properties, methods and events of the class;

· encapsulation – concealment of the complex mechanism of action of an object;

· polymorphism – objects different classes can use methods of the same name that work differently for different objects.

Collection of objects is a set of objects combined common name, and these are not necessarily objects of the same class. An example of collections are the collections built into VB, including:

· Forms(Forms) – a set of downloaded application forms;

· Controls(Controls) – the set of all controls on the form.

Namespace is a hierarchical class library organized under unique names such as, for example, System.Windows or System.Math . To access classes and objects based on them that are part of a namespace, the operator can be placed at the beginning of the program code Imports . Every project in VS also contains a root namespace. The namespace in the VS documentation is also called class libraries .

Event is a means of interaction between objects and each other. An event can be created by the user or arise as a result of the influence of other software objects. Objects can generate events and perform actions in response to specified events. Examples of events – forms ,Click ( Click ) mouse over the object, DblClick ( Double click ) mouse and others . As a reaction to events, an event procedure is called, which can change the properties of the object, call it

In VB language , as in many other programming languages ​​designed for writing applications for MS Windows , used
event-driven programming model. This essentially means that no application can function on its own without interacting with other applications and the operating system. For example, let's take the simplest case, when the command is specified by pressing a key on the keyboard. It cannot directly affect any of the applications, and MS Windows in this case acts as an intermediary. By sensing a keypress event, operating system decides where to pass processing of this event. The keystroke message is then sent to the application. The application processes it by parsing keyboard input and displays the message, for example, in an active text field.

Applications created With using VB , They work on the same principle. In this case, VB performs, as it were, internal work. For example, when a button is clicked in an application, an event is raised - VB intercepts the corresponding MS Windows message and raises the event Click object Button .

Note that in event-driven programs, there is no continuous program code that runs from start to finish. This means that after starting the program, the user does not have a clear idea of ​​the specific path of execution of the algorithm. That is, you can click on any button in the application at any time or perform, for example, entering text in a field, or you can stop processing if you wish. Therefore, the application is forced to wait until one of these events occurs before executing the specified program code. Thus, an event is always required to start executing program code - this is one of the the most important rules creating applications in MS Windows environment .

The response to events is a call event procedure , which was previously created by the software developer. The meaning of such a procedure is to perform programmed actions: changing the properties of an object, calling methods, performing calculations according to a given algorithm with outputting the result to certain places in the application, etc., for example, if the user presses a button, then a certain sequence of actions is performed as a response, which defined in an event procedure in accordance with a given algorithm.

In addition to event procedures, the user can create general procedures (user procedures).

User procedure is a complete program code that implements a separate algorithm for the problem being solved. However, such a procedure is called by the name of the procedure, and not as a result of any event.

Method is a procedure that implements actions possible with an object. As a result of these actions, something changes in the object. VB provides the user a large number of built-in procedures located in the library, and ready to use. These procedures are an integral part of the class library, that is, they are methods of classes in the .NET Framework.

Facilities procedural programming(procedures) - an integral part of any high-level programming language, which is one of the main parts of the paradigm modern programming. But it was only with the advent of languages ​​that supported object-oriented programming that special types of built-in procedures were introduced, called methods . Methods “work” like procedures, but belong to specific objects, just like properties. In program code, you can access a method in the same way as you can access a property. using dot notation.

In the VB environment you can create own procedures, created by software developer .

Please note that any project program code written using VB consists of many procedures, that is, all the program code is located inside a set of subroutine procedures and function procedures, and the procedures themselves are inside a class (module).

Subroutine procedures begin with a keyword Sub End Sub, and function procedures begin with the keyword Function and end keywords End Function , between which the program code of this procedure is placed. The program code of each procedure consists of one or more statements in the VB programming language.

Event handling method is a complete program code that implements a separate algorithm. For each event, you can program a response, i.e., the object’s reaction to the event that occurred; as a result, a certain sequence of actions will be performed - a method for processing the event.

The name of an event procedure consists of three parts (including the underscore): ObjectName_EventName.

Thus, every time you write code that must be executed in response to an event, you create an event procedure that is called automatically when the corresponding event occurs (for example, a button being pressed).

Operator is a programming language construct that specifies one or more operations , produced over operands . Operands can be constants, variables, expressions, functions, etc. Any operator is written in accordance with the syntactic rules of the programming language. For example, in the assignment operator the sign " = " reads "assign" and means that a value equal to the value of the expression to the right of the " sign is written to the computer memory = " For example, the line

Form4.1.Text = "Form with picture" means that in memory with the name Form4.1.Text the value is written - text "Form with picture", and the line P=A+B+C used in a program to evaluate the value of an expression and assign it to a variable R .

Project– this is an application being developed (application program code) – a set of files that stores information about all software components, used in this application. Since V.B. , on the one hand it is object-oriented visual programming system, since it allows you to program algorithms in this language, and on the other hand, this system is software design environment, then the result of the programming and design processes is a project that combines program code and a graphical interface. Therefore, in order to burn or load any software project to disk, you need to burn or load the project, which contains all the components (files). Typically, a VB application consists of many files, including a project file, with the extension .vbproj . A project file contains information related to one software task - one application.

A project is also a compilation unit. The result of compiling a project is an assembly. Each project contains one or more namespaces. At the initial stage of creating a project for given project type is automatically built project framework , consisting of classes that are inheritors of classes included in the library FCL(Framework Class Library) - class libraries of the .NET Framework platform. So, if a developer specifies that he will create a project like " Windows application Forms", then the default project framework will include the object Form1– heir to the library class Form. The developer of the software project will add controls to the created form - objects of the corresponding classes, thereby expanding the capabilities of the default form.

Each project contains all the information needed to build an assembly. The project includes all files with classes that were built automatically at the time of project creation, and files with classes created project developer. The project also includes installations and resources required for the job. Part of the project is also a file containing a description of the assembly (manifest).

Depending on the selected type, the project may be carried out or unimplementable. Projects carried out include, for example, projects like Console application or Windows Forms Application. When building the skeleton of a running project, it includes a class containing a static procedure called Main(). As a result of compiling such a project, it creates P.E.-file – executable portable file with extension .exe. Such P.E.-file can only be executed on computers where the Framework .Net, because it is a managed code file.

Non-executable projects include, for example, projects like
Class Library (DLL), which has an extension. dll, and is dynamically linked library, those. these projects are intended to be included (linked) into other projects. As a result of compiling a project like
Class Library the assembly will include a file with the extension .dll. Such projects (assemblies) cannot be directly executed on a computer. They are attached to executing assemblies, from where methods of classes located in the non-executing project are called ( DLL).

Stages of implementation of the simplest projects– can be divided into several steps:

· creation of a graphical project interface (user interface), which should ensure interaction of the project with the user during the operation of the project;

· setting the values ​​of properties of graphical interface objects;

· creating, editing and debugging project code;

saving the project for further use;

· project implementation.

Solution is an application under development, the files of which contain information about one or more projects, usually related to a common topic. The solution file is used to manage multiple interrelated projects and has the extension .sln. Moreover, each project created in VS is placed in one shell, called By decision.

When created new project, then it can be placed in an already existing Solution or a new one can be created Solution containing the project.

So, pay attention again to the following:

Class is the central concept of object-oriented programming. VB project developer uses standard classes from the library FCL and creates its own classes. Moreover, the class performs two different roles:

· Class - firstly, this is a module - an architectural unit for constructing a project according to modular principle. Coping with the complexity of a large project can only be done by dividing it into modules - relatively small units that allow independent development and subsequent integration into a larger system.

· Class – secondly, it is a data type, that is, a semantic unit that describes the properties and behavior of a set of objects called instances of a class. Syntactically, a class represents a description of data called class fields, description class methods and description class events . For a class, considered as a data type, fields determine the state of objects, methods determine the behavior of objects. Events are some special states that an object can be in, and which can be handled by event handlers external to the class. So, for example, an object of the class HUMAN may have the event " Birthday"and each of the handlers of this event can bring their congratulations to the object on this occasion.

Typically, classes play both roles. But in VB you can define classes that only play the role of a module. This modules , for which it is impossible to create objects.

Nice style programming requires that each class be stored in separate file, whose name would be the same as the class name. This is a style requirement that may not be met in practice. In our examples we will try to maintain this style.

By defining a class, the project developer is able to dynamically create objects of the class. For programmers starting to work in the object style, typical mistake is a confusion between the concepts of object and class. You need to understand the difference from the very beginning. An object class created by the developer represents a static description of a set of objects. The object is dynamic concept, it is created during the execution of a software system, actually exists in the computer's memory, and usually disappears when the project is completed. The project developer can create software system, including two or three classes, but during the operation of such a system hundreds of objects can dynamically appear, interacting with each other in a complex way.

VS main window

Note that the process of creating a simple application in the VS environment will be described in detail in the following Topic 4.2, as well as in laboratory work By Topic 4.1."Visual Studio .NET Integrated Development Environment." Now get acquainted with the interface of the VS environment.

Launch MS Visual Studio.

The screen will appear home page- MS VS ( rice. 4.1.2-1).

There are several main panels in this window: Standard menu , window Standard toolbar window Home page anits A, window Solution Explorer, window Elements panel.

Rice. 4.1.2-1. Home page -Microsoft Visual Studio

It should be noted that when working with VB in the VS integrated development environment, you can use both the standard toolbar buttons and the main menu items located at the top of the screen.

VS provides the user with a variety of toolbars. These toolbars contain buttons whose functionality depends on the functionality of the specific toolbar.

Window home page allows you to open recently used projects, searches for examples, contains various links to sites that can help you work with VS . In addition, while working with the project, various windows will be displayed in place of the initial page, for example, the window Form designer, window Code editor and etc.

In the window Solution Explorer The files of the current solution(s) are displayed. This window is used to get detailed information about objects . It allows you to search and explore elements, their properties, methods, events located in projects and links to them.

Tools designed to facilitate application development also include the window Elements panel, displaying controls used in VB projects .

To create a new project, use the dialog box
Create a project(Fig. 4.1.2-2). To open it, you must do one of the following:

· execute command Create a project from the Main Menu element – File;

· press the button Create a project, located on the standard toolbar.

Rice. 4.1.2-2. Dialog window Create a project

In VB you can create applications using various templates. In this tutorial we will only use the template Windows Forms Application.

This application is designed for creating traditional Windows applications, user interface for which it is designed using MS Windows forms. Moreover, you can set certain characteristics for the form of this template and place various controls on it.

Let's take an example of the basic steps required to create a project Windows Forms Application.

Example 4.1.2-1. Create a project named Example 4.1.2-1 and a graphical interface consisting of a form with one button and one text field. When you press the button, “Hello, MTUSI!” should appear.

Project form Example-4.1.2-1 may look like in Fig. 4.1.2-3.

Rice. 4.1.2-3.Graphic interface (Form) of the projectExample 4.1.2-1

To implement the project Example 4.1.2-1 the following steps are required:

1) Launch VS.

2) Create a new project:

File and then run the command Create a project;

· select a project template Windows Forms Application .

As a result, a window will open Form1.vb[Constructor]Form Builder(as indicated by the corresponding tab), which allows you to implement a graphical interface for the application.

· select a Main Menu item File and then run the command Save all ;

As a result, a dialog box will open Save project;

· enter in the field Name name of the project Example-4.1.2-1(by default, the VB environment names it WindowsApplication1), and then enter Location directory name, where the project will be located, or use the button Review to search for the required directory (Fig. 4.1.2-4);

· click on the button Save ;

As a result, the development environment will look like in Fig. 4.1.2-5.

Rice. 4.1.2-5. Development environment

Visual Studio Panel Windows

Panel window home page(Fig. 4.1.1-1) allows you to view recently used projects, search for example programs, both from help and the Internet, and also view links to sites containing news about the VS product , documentation, tutorials.

Rice. 4.1.4-1.Panel windowForm Builder and its context menu

The start page automatically opens when VS starts . If the window home page does not appear, it can be called using the command home page main menu item View.

Panel window Form1.vb[Constructor] (Form Constructor)
Main window
is Main working window , in which the visual design of the application is performed (Fig. 4.1.4-1). You can display this window on the screen by clicking on the tab Form1.vb[Constructor] or double click on the form name in the window Solution Explorer.

In the window Form designer All forms of the application are visually created using the development environment tools. You can use a grid to precisely position objects on a form in a window.

The size of the form in the window can be changed using the shape selection handles and the mouse. To change the size of the form, you need to place the mouse pointer on the marker and, when it changes to a double-headed arrow, move it to the required size.

For working in a window Form1.vb[Constructor] you can use the context menu (Fig. 4.1.4-1).

Rice. 4.1-2. Panel windowCode editorboth her and the context menu

Panel window Form1.vb (Code editor)- it's powerful text editor With big amount capabilities, which is the programmer's main tool for creating and debugging program code. It can also be located in Main working window(Fig.4.1-2) .

Panel window Solution Explorer and its context menu is shown in Fig. 4.1.4-3.

Rice. 4.1.4-3. Panel windowSolution Explorer and its context menu

Panel Controls grouped by sections
(Fig. 4.1.4-4). To create benefit forms, you mainly need a section Standard controls ( rice. 4.1.4-5).

Panel window Properties is intended for displaying and setting the properties of project objects, including the form and the objects placed in it. This window, for example, contains such properties of the selected object as position in the form, height, width, color and others (Fig. 4.1.4-6).

To open a dialog box Properties You should do one of the following:

· in the main menu element View select a team Properties Window;

· click the Properties window button located on the Standard
toolbars;

· select a team Properties context menu selected object;

· press a keyboard key .

Rice. 4.1.4-4. Elements panel window 4.1.4-5. Panel

controls grouped by sections ( Standard elements)

Rice. 4.1.4-6. Panel windowProperties

Since the form and controls are each objects in themselves, the set of properties in this window changes depending on the selected object. Using buttons IN alphabetical order And
By category object properties can be viewed in alphabetical order or by groups (categories), respectively.

A tooltip appears at the bottom of the window explaining the purpose of the selected object property. A more detailed explanation can be found in the help system. You can also use dynamic help by selecting the desired topic in the window Dynamic help.

Using the dialog box Properties, You can change the default properties of objects. Some object properties, for example, dimensions and location, can be set by moving the object and changing its dimensions using the mouse in the form designer. Properties set in the Properties window can be changed while the application is running by writing appropriate codes in procedures created using the code editor.

Typically, a form contains many objects. If you select several objects at once, then in the properties window you can see the properties common to these objects.

4.1.5. Setting up integrated settings
development environment

Tool windows, reference system, the compiler parameters of the VS development environment are easily and very flexibly configured.

Next steps show how to change the development environment settings in VB according to the recommendations for implementation practical work:

1) In a main menu item Service execute command Importing and Exporting Settings. You can use the wizard that appears to save your environment settings for use on another computer, load settings from another computer, or reset settings—the option you need to select now.

2) Choose Reset all settings, and then click on the button Further. VS will ask if you need to save the current settings to a file before configuring. Should always be saved backup copy their current settings so that there is an opportunity to return to them if the new settings turn out to be “inconvenient”.

3) Check that the option is selected Yes, and pay attention to the file and folder name where VS is going to save these settings.

4) If you need to return to these settings, use the same wizard and option to restore them Import selected environment settings.

5) To see a list of default settings used for VS, click on the button Further.

6) Click on Options for VB development, and then click on the button Ready.

7) The wizard will switch IDE options, including menu commands, toolbars, and settings for some dialog boxes, windows Tools And Code editor.

8) You can repeat this setup process any time you need to reset current parameters(for example, if you made a mistake in the settings), or if you need to configure VS to use a different programming tool.

9) To close the wizard, click the button Close.

If the environment settings for working with VB are configured, you can complete tasks. But if they have been changed, you need to do the following actions, allowing you to check that the settings associated with projects and the VB compiler correspond to those used in practical work. To check the project and compiler settings, do the following:

1) Click on the command Options menu item Service and open a dialog box Options.

2) Dialog window Options– This is the window where many of VS's configuration options are located. To see all the parameters that can be changed, you need to click on the checkbox Show all options located in the lower left corner of the dialog box.

3) In the dialog box Options click on category Projects and solutions and then on the section Are common. This group of checkboxes and options configures settings for VS projects and solutions. To software matched the settings used in this tutorial must be configured and

Creating a graphical user interface, during which you need to place graphic elements, select general structure and the flow of applications encourages the programmer to become something of an artist. There are no standard rules to help with creating presentations, arranging elements, and organizing structure. A successful graphical user interface is considered a work of art. Since creating interfaces is an art rather than a science, there are no hard rules to follow in this field. Too many parameters are determined by the nature of the application, users, and context.

However, there is whole line practical recommendations, which should be followed by developers to facilitate interface design.

¦ Complex structures (such as a tree) for communication should be avoided various menus. It is best to include no more than six menus in one menu line, each of which will contain no more than six options.

¦ Objects must have a consistent meaning. For example, to activate all icons, double-click the mouse. Some modern interfaces do not meet this recommendation and contain pictograms that only become effective after the user has towed

object to them. Scroll bars should only be used for scrolling, and if pre-made library icons are used, you should check them carefully to ensure that, for example, the printer icon is always used for printing.

¦ When activating all icons, as noted above, you should double-click the mouse. And to obtain a similar result for icons of objects that are activated single click mouse, it is also recommended to program a double click. Many options, such as those found in the Control Panel menu, look like icons but are objects that can be activated with a single click of the mouse. You should anticipate how users might behave when working with such objects (i.e., expect them to double-click on them) and help them achieve the desired result.

¦ Interface menus should reflect the current state of the system. One of the basic principles that guides most graphical user interface designers is to ensure that all interface features are accessible regardless of user actions. The bottom rule agrees well with simple applications, but for more complex ones it is less useful.

¦ Elements common to different menus should be placed in one place. But for example, the OK and Cancel buttons should always be positioned the same relative to each other and occupy the same place in different dialog boxes.

¦ You should not strive for consistency of menu elements if this does not correspond to the opinions of users. For example, users believe that dragging a file from one folder to another on the same device causes the file to be moved to the second folder.

They also believe that dragging a file to another device creates a copy of the original there. It follows from this that the implementation of the towing function will be inconsistent, i.e. different in different cases. However, this is the wish of users who must be taken into account. Striving for consistency is only a recommendation, not a hard and fast rule.

Ergonomic requirements for graphical user interfaces turned out to be clearly insufficient with the development of “multimedia” - interactive systems that provide work with still images and moving video, animated computer graphics and text, speech and high-quality audio. Ergonomic research and development of these systems presents a challenging and professionally exciting challenge.

Most application development project managers, notes B. Tognazzini, wait until the end of the project to start working on the interface. This is reminiscent of building a house, when an architect is invited after constructing the frame of the building. All developers have different approaches to organizing the interface creation process. However, there are general points that all developers should adhere to:

1) understand the purpose software product in every detail by communicating closely with users, often spending entire working days with them in order to better understand their work style and individual habits;

2) creating an interface is not the work of a single person, but of representatives of three areas: a specialist who finds out users’ opinions about the main elements of the interface and describes them; interface developer and graphics creator;

3) one experienced employee should be appointed as an interface expert and intermediary between working group and users;

4) testing, creating a layout and testing again, since even if the purpose of the software product is completely understood, it is impossible to provide for all user needs.

Interfaces should be created by people, D. Norman believes, who do not take part in the development of the application, since developers know too much about the principles of the program, and this only interferes with the creation of the interface. The advantages of a graphical user interface are generally recognized, and perhaps
Therefore, he did not become the object of serious analysis. The traditional rule of a program developer, according to which ease of learning often prevents the user from subsequently fully using all the capabilities of the program, also applies to the graphical interface. An example is the development of a project for an American insurance company, in which they used one insurance application for Macintosh, equipped with an excellent interface that was very easy to learn. However, after two years of work end users so mastered various functions this application that the graphical user interface only slowed them down. The choice of graphical interface should be determined by the nature of the user's task.

yadobr January 14, 2014 at 09:10

Graphical User Interface Design

  • Interfaces

Introduction

IN modern world billions of computing devices. More more programs for them. And each has its own interface, which is the “levers” of interaction between the user and machine code. Not surprisingly, the better the interface, the more effective the interaction.

However, not all developers and even designers think about creating a convenient and understandable graphical user interface.

For myself, I started by asking questions: general principles, what interface elements (EI) create what design they should have, where they should be placed correctly and how they should behave.
Below I will try to answer these questions.

General principles


What EI should I create?


What should the EI design be?

In fact, EI design is the topic of a separate article. Here you need to take into account everything: from color, shape, proportions, to cognitive psychology. However, a few principles are still worth noting:

How to correctly position the EI on the screen?


How should EIs behave?


In custody

This article does not claim to be the most comprehensive guide to interface design principles. Graphical user interface is a vast topic, closely intertwined with psychology, occupying the minds of scientists and hundreds of pages of books and studies. In such a small format, there is no way to express the fullness of the topic raised. However, compliance basic principles, will allow you to build more user-friendly interfaces, as well as simplify the design process itself.
Thank you for your attention.

Literature

Jeff Raskin, “Interface: new directions in the design of computer systems”
Alan Cooper, “About the interface. Fundamentals of Interaction Design"
Alan Cooper, “Mental hospital in the hands of patients”