Tools for visual programming and program design. Visual programming or a little theory about Visual Basic


Visual programming is one of the technologies in modern programming

Visual programming (from the Latin visualis - visual) is a programming technology that involves creating applications using visual aids.

Visual programming can also include Rapid Application Development (RAD) - rapid program development. RAD is a programming technology that enables accelerated development and modification of applications through the use of object-oriented and visual programming.

Visual programming tools usually solve the problems of building a user interface and simplifying application development by replacing the “writing a program” method with the design method.

Visual programming undoubtedly has the advantage of visually presenting information and is much better suited to the nature of human perception than traditional, text-based programming methods. However, almost all visual tools need to be supplemented with functions that cannot be presented in the form of graphical structures and require textual expression. Visual aids are complemented by special programs - “scripts” written in various programming languages.

For example, IBM has most fully implemented the concept of visual programming in the VisualAge Smalltalk environment.

VisualAge is a powerful application development environment for client-server architecture. The environment is focused primarily on the development of business applications, including systems for online transaction processing and decision support systems. VisualAge allows professional developers to build client parts of application systems with complex graphical interfaces, design business logic for applications with access to local and remote resources.

VisualAge is an object-oriented development tool that includes a set of visual interactive tools, a library of ready-made components and a set of tools for building a client-server environment.

GUI support provided by ready-made components meets CUA (Common User Access) specifications and contains a number of extensions for organizing flexible I/O in complex forms and tables. The library of ready-made components also provides support for multimedia devices, communications via APPC, TCP/IP, NetBIOS protocols, CICS External Call Interface, EHLLAPI, Message Queue Interface (MQI) programming interfaces, work with relational databases of the DB2, Oracle, Sybase families and much more .

Microsoft, while developing the concept of the .NET Framework, created Visual Studio.NET Enterprise Architect 2003, in which it implemented all the latest advances in the field of programming and, in particular, in visual programming technology.

Visual Studio.NET is a complete multilingual development environment for the Microsoft.NET platform. Visual Studio.NET provides a set of technologies that make it easy to create, deploy, and then enhance secure, scalable, and highly available web applications and XML web services.

Borland Software Corporation traditionally develops an integrated programming environment that has undoubted success in the market of professional software products. This environment has always supported visual programming methods, offering the developer powerful libraries, interactive wizard builders, and ready-made graphical interface elements. Today, Borland Developer Studio is a software product from Borland Software Corporation, which is a rapid application development (RAD) environment for the Win32 and .NET platforms in Delphi (Object Pascal), C++ and C#.

Another package from Borland is Delphi Enterprise Edition 7.0. This package provides support for the latest emerging Web services technologies and includes a preview of tools for working with the Microsoft .NET Framework.

With Delphi 7, Delphi developers can acquire .NET programming skills and prepare their applications to run on .NET without losing their existing knowledge and skills on the Windows platform. The Delphi 7 development environment is all about design; deploying model-driven architecture (MDA); integrating modeling, development and deployment of e-business applications and systems for the Windows platform.

Borland Software Corporation is the first company to open an independent path to .NET with Delphi 7, a cross-platform rapid application development (RAD) environment for the Windows platform. A characteristic feature of Delphi 7 is the ability to develop and deploy enterprise applications. This allows developers to build enterprise applications from concept to finished product even faster using the new UML™ designer and Model Driven Architecture™ (MDA™) technology.

We examined the role and place of visual programming in the field of modern programming. Now let's move on to consider specific techniques and methods related to visual programming. Let's look at the use of visual programming components and techniques within Microsoft's Visual Studio.NET Framework.

Visual Programming Basics

Visualization is the process of graphically displaying complex processes or concepts on a computer screen in the form of graphical primitives. You can visualize many processes: management, construction, drawing, etc.

Application users are accustomed to the graphical interface of applications and often do not even think that familiar interface elements are visual graphic primitives. For example, the simplest visualization option is a progress bar (a rectangle whose filling percentage is directly proportional to the time it takes to complete an operation). By looking at it, you can roughly estimate the completion time of the operation. But, if the execution time value was displayed as a number or percentage without a progress bar, then such an output would only be a display of the current value, but not a visualization of the process.

Today it is common to visualize software interfaces. Visualization removes the problem of “communication” between the user and the software product. Graphic images on the control elements allow the user to intuitively understand the purpose of these elements.

To visualize software interfaces, there are a number of specially designed interface elements - visual components that allow you to display various information and manage the program as a whole. The simplest example is a visual button on a computer screen. The software button imitates the behavior of a regular button on the control panel of any device. The button can be “pressed” like a real one.

Perhaps it was the presence of visual tools for constructing interfaces in languages ​​such as Microsoft Visual Basic and Delphi, as well as the visual programming interfaces created using these languages, that assigned them the term “visual programming”. Of course, there are many other similar products (Visual C++, Borland C++ starting with version 4, Symantec Visual Cafe, C++ Builder, etc.), but they could not gain such popularity as Visual Basic and Delphi. It was thanks to Visual Basic that the world learned about the possibility of visually building program interfaces for Windows.

In Visual Basic and Delphi, the program interface is visually constructed, but not the code itself. The defining elements of the visualization process are:

  • A visualized model is a model that is displayed in order to be able to change its structure or its parameters (or the parameters of its individual parts).

  • Toolbox - a window containing a set of elements from which a visual model is built. Typically, elements are divided according to their purpose into separate groups, located on separate tabs of the tool window.

  • Properties window (PropertyBox) - a window in which the parameters (properties) of the selected element of the visual model are displayed. The term "property" comes from object-oriented programming and denotes a parameter of an object (element).
  • The visualized model in Visual Basic and Delphi is a Windows window (form, dialog), and not the program code.

    A common practice is to visualize work with interface elements, when the visual components that make up the forms (windows and dialogs) of the program interface are considered as visualization objects. But program statements can also be considered as visualization objects. In this case, the parameters of the program's operators and functions can be configured using the properties window (PropertyBox), and the operators and functions themselves are stored in list form (tabular form).

    As a possible option for implementing such visual development of program code, we can consider the tabular form of recording macros in Microsoft Access (Fig. 8.1). In this case, the visualized model is a macro program for managing data in a database or managing the process of displaying data. Macro commands are located on different lines of the macro record. The properties window is located directly below the list of commands. There is no tool window in the usual form, but it is implemented in the form of a drop-down list with commands, i.e. In each line of the macro recording individually there is the ability to select or change the current macro command. This is the visualized form of writing the program.

    Fig.8.1. Visualization of program code development

    Attaching a module created by visual programming tools is also performed by visual means - in the design mode (Fig. 8.2).

    Fig.8.2. Visual programming tools

    Another example of visualizing the creation of program code is the process of creating macro programs in Microsoft Excel (Fig. 8.3).

    Fig.8.3. MS Excel dialog when automatically recording user actions

    The visualized model in this case is an Excel worksheet in which the programmer performs data processing actions. The program code is written automatically in the background, and all visual user actions are described in VBA (Visual Basic for Application) statements.

    The Properties window is present, but not in the worksheet itself, but in the VBA environment (Fig. 8.4). When you select a Module object, the tool window turns off, but if you edit program code, a drop-down list with properties, methods and events appears for each program object, i.e. In each line of the macro recording individually there is the ability to select or change the current macro command.

    An example of the resulting program, the call of which in an Excel worksheet can be organized by a command button or directly by the name of a recorded macro, is shown in Fig. 8.4.

    Fig.8.4. The result of automatic recording of program code as a log of user actions

    Using visual programming when building an application interface in Visual Studio.Net

    Visual Studio.NET is a universal development environment for all types of .NET-based applications and based on a single visual interface. The .NET Framework is a set of objects and plans (blueprints, that is, descriptions of objects) created by Microsoft for developing applications (Windows and Internet). A large collection of visual objects allows you to design various controls: Caption, Caption with hyperlink, Button, Field, Checkbox and many others. All these elements are located on the toolbar (Fig. 8.5). Element properties are configured using the property list.

    Controls, like all other .NET objects, are implemented as classes in a specific namespace, in this case System.Windows.Forms.

    Fig.8.5. Visual programming using Visual Studio.NET

    Element methods are programmed by the user “manually”, but there are also visual assistants here: after double-clicking on a control element in the designer, a code editor window automatically opens and the title of the event handling procedure is automatically written. Moreover, after typing the name of the object, a list of properties and methods of the object automatically appears (Fig. 8.6). Thus, the process of writing program code is also partially visualized.

    Fig.8.6. Visualizing object properties and methods

    In addition to controls, as a rule, the application interface also contains other standard components, the implementation of which is also supported by visual programming tools, for example, standard dialog boxes.

    There is no separate Dialog class in .NET. A dialog box is a form (Fig. 8.7.) that has some special characteristics. Programming dialog boxes, like many other standard components, in Visual Studio is supported by visual programming tools (Fig. 8.8).

    Fig.8.7. Example of a standard dialog

    Fig.8.8. Programming standard elements using Visual Studio

    The .NET Framework and Visual Studio .NET provide programmers with a huge library of objects to speed up the application development process. Many objects in this library have a visual representation and provide the ability to assign object properties in design mode using the Properties window or dialogs with the builder wizard.

    conclusions

    Visual programming involves creating applications using visual aids.

    Visual programming tools usually solve the problems of building a user interface and simplifying application development by replacing the “writing a program” method with a design method.

    Visual programming has the advantage of visually presenting information and is much better suited to the nature of human perception than traditional, text-based programming methods. However, almost all visual tools need to be supplemented with functions that cannot be presented in the form of graphical structures and require textual expression.

    The concept of visual programming is implemented in many modern software systems development environments. All leading companies that create programming and design tools have systems that support visual programming technology.

    Visual programming support in Visual Studio.NET turns programmers into Windows and Internet application developers.

    Self-test questions

    1. What is the fundamental difference between visual programming and any other programming?
    2. Is it possible to create a complete software application using visual programming?
    3. What are the advantages and disadvantages of visual programming?
    4. Which programming languages ​​support visual programming style?
    5. In which programming environments is a visual programming style implemented?
    6. Which software package companies have the best visual programming solutions?
    7. Can we say that visual programming is the construction of a graphical user interface?
    8. What elements of the visualization process can you list?
    9. What is a “visualized model”?
    10. Give examples of visual programming in software environments known to you.

    Literature

    1. Garnaev F.Yu. Self-instruction manual Visual Studio.NET 2003.- St. Petersburg: BHV-Petersburg, 2005.- 688.p.: ill.
    2. Podlin Sh. Master your own programming for Microsoft Excel 2000. Transl. from English: Uch. Pos. - M.: Williams Publishing House, 2006. - 304 p.: ill. - Parallel. tit. English
    3. Kharitonova I.A., Mikheeva V.D. Microsoft ACCESS 2000: Application Development. - St. Petersburg: BHV-Petersburg, 2004. - 832 p.: ill.

    Program development environments

    Integrated programming environments are different programming environments combined into one software package and using the same tools (for example, Microsoft Visual Studio includes several programming languages, but with a combined compiler, i.e., in any programming language (from those included in the package) a program is written, then assembled (each language has its own assembly) and transferred to the compiler (there is only one compiler) or they use the same program debugging tools, etc.).

    Also, support for various ActiveX, COM, ADO and other technologies is integrated into the development environment, which allows you to write programs or components using these technologies.

    Typically, the development environment includes a text editor, a compiler and/or interpreter, build automation tools, and a debugger. Sometimes it also contains tools for integration with version control systems and a variety of tools to simplify the design of a graphical user interface. Many modern development environments also include a class browser, an object inspector, and a class hierarchy diagram for use in object-oriented software development. While there are development environments designed for multiple languages, such as Eclipse or Microsoft Visual Studio, typically a development environment is designed for one specific programming language, such as Visual Basic.

    Examples of development environments - NetBeans, Eclipse, Sun Studio, Turbo Pascal, Borland C++, GNU toolchain, DrPython, Borland Delphi, PascalABC.NET, Dev-C++, Lazarus, KDevelop, QDevelop, QNX Momentics IDE, XCode

    Visual programming is a way of creating a computer program by manipulating graphical objects instead of writing text.

    It is necessary to distinguish:

    graphical programming language - which is primarily a programming language (with its own syntax)

    visual development tools - as a rule, they mean interface design tools or some kind of CASE system. for rapid application development or a SCADA system for programming microcontrollers.

    Visual programming languages ​​can be further classified depending on the type and degree of visual expression, into the following types:

    object-based languages, where the visual programming environment provides graphical or symbolic elements that can be manipulated interactively according to some rules;

    languages, in the integrated development environment of which forms are used at the interface design stage, with the ability to configure their properties. Examples: Delphi and C++ Builder from Borland, C#


    diagram languages ​​based on the idea of ​​“shapes and lines,” where shapes (rectangles, ovals, etc.) are treated as entities and connected by lines (arrows, arcs, etc.) that represent relationships. Example: UML.

    With the invention of visual programming, the first sign of which was the Visual Basic development environment, creating a graphical user interface became possible even for a beginner. In the Visual Basic environment, you could quickly create an application for the Windows operating system, which had all the elements inherent in a graphical user interface: windows, menus, buttons, input fields, etc. All these elements have become the building blocks of the program - components - objects that have a visual representation at the design stage and during operation.

    User interface design has been simplified by an order of magnitude, however, for professional programmers, the Basic language turned out to be clearly weak. Its lack of control over data types and a mechanism for expanding them turned out to be a stumbling block to the creation of serious programs. Creating non-standard components in the Visual Basic environment was extremely difficult (for this it was necessary to resort to other development tools, in particular, the C++ language). In general, Visual Basic was great for prototyping applications, but not for developing commercial software products.


    form of control: test

    semester 4 (full-time)

    semester 5 (correspondence)

    1. Visual and verbal in culture: the problem of correlation.

    2. “Machinery” in the culture of the Renaissance and Post-Renaissance (camera obscura, profile machine, laterna magic).

    3. Perspective systems: comparative analysis.

    4. Architecture as a communication system.

    5. Reproduction technologies of the pre-industrial era.

    6. The origin of photography (the experiments of Niepce, Daguerre, Talbot and their results).

    7. Daguerreotype and calotype: comparative analysis.

    8. Photograph of the mid-19th century. (based on the wet collodion process).

    9. Portrait in photography 1850 – 1870s. (using the example of the works of Nadar, Dizderi, J.-M. Cameron, A. Karelin).

    10. Pictorial photography and the problem of the relationship between art and photography.

    11. Photography of motion (experiments of Muybridge and Marais).

    12. The concept of the New Vision in avant-garde culture of the 1920s – 1930s. (using the example of the activities of Dziga Vertov, L. Moholy-Nagy, Lisitsky, Rodchenko, etc.).

    13. Photography in the system of production and utilitarian art.

    14. Walter Benjamin and his essay on photography and reproduction.

    15. Social photography of the 1930s (A. Zander, D. Lange, W. Evans, B. Shan).

    16. Photography in French surrealism (Man Ray, Boaffard, Bellmer, etc.).

    17. Photograph of the mid-20th century. – leading masters.

    18. Roland Barthes and his book about photography.

    19. The place of photography in contemporary art (pop art, conceptualism, Cindy Sherman, Sherry Levine, Richard Prince, A. Gursky, D. Wall, B. Streuli, etc.).

    20. The influence of new technologies on photography. Computer photography.

    21. Photography and painting: history of relationships (from “artistic experiments” in photography of the 1850s - 1860s to the modern situation).

    22. Background to the emergence of cinema.

    23. Features of cinema as a means of mass communication.

    24. Cinema: visual and narrative aspects.

    25. The main innovations of early cinema (1890s - 1910s).

    26. Creativity D.-U. Griffith.

    27. German film expressionism of the 1920s.

    28. Film avant-garde of the 1920s – 1930s: general development trends.

    29. Soviet editing cinema of the 1920s: main works.

    30. The problem of the relationship between sound and image in cinema. The formation of sound cinema.

    31. Cinema of the 1930s – 1940s: general characteristics.

    32. Cinema of the 1950s – 1960s: general characteristics.

    33. Modern cinema: main directions of development.

    34. Origin and history of animation.

    35. Marshall McLuhan and his media theory.

    36. The theory of avant-garde and kitsch. The role of visuality in modern mass culture.

    37. Genre of video installation.

    Introduction to Visual Design

    Visual design

    Delphi, being a visual application development environment, is aimed at those programmers who “assemble” specific applications for end users from ready-made components. Delphi visual tools are built on the concept of dual tools (Two-Way Tools), which allows you to change the properties of objects both during the visual design process at the “assembly” stage (Design time), and programmatically, during the operation of the application (Run time). Delphi implements this concept using components.

    On the other hand, being an extensible object-oriented toolkit, Delphi allows you to create your own components.

    A component is a class designed in a special way. Its properties can be changed at the “build” stage of the program using the Object Inspector. All changes are immediately displayed on the monitor screen, so this approach allows you to quickly create the interface part of the application. As you know, this part usually takes up to 80% of a programmer’s work.

    Delphi components are combined into a VCL library - Visual Component Library. All Delphi components can be classified as follows:

    Invisible (non-visual) components are typically components that access system resources, such as the system timer. They are displayed during interface design, but are not visible while the application is running.

    Control elements allow the user to receive information and/or control the operation of the program while the program is running.

    Window elements, visual control components, can accept input focus (become selected), they are windows of the Windows system and have all the properties of a window, that is, they have a unique Windows identifier and receive messages from the operating system.

    Graphical components differ from the previous ones in that they do not have an identifier and, accordingly, cannot receive messages from Windows. They take up much less resources from the system than all others.

    Delphi's class hierarchy is a well-chosen hierarchy of base classes. This is largely due to the fact that traditionally it has been quite difficult to implement a user interface in the Windows environment. The event model in Windows has always been difficult to understand and debug. But it is interface development in Delphi that is the easiest task for a programmer.

    The Delphi environment includes a complete set of visual tools for rapid application development (RAD), supporting user interface development and connecting to corporate databases. VCL - a library of visual components - includes standard objects for constructing a user interface, data management objects, graphic objects, multimedia objects, dialogs and file management objects, OLE management.

    The component palette (Fig. 4.1.2) allows you to select the necessary objects to place them on the Form Designer. To use the Component Palette, simply click on one of the objects in the Component Palette for the first time and then click on the Form Designer a second time. The selected object will appear on the projected window and can be manipulated with the mouse.

    The Components Palette uses page-based grouping of objects. At the top of the palette there is a set of tabs - Standard, Additional, Dialogs, etc. To select a page of the component palette, use the navigation arrows located in the upper right corner.

    Visual Basic belongs to a group of software under the general name of programming systems. The programming system provides the user with an environment for developing programs, and in Visual Basic this is called application design.

    The Visual Basic programming system includes a text editor for writing program texts and a form designer. A programmer writes source code for programs in a formalized language, which is a sequence of commands or statements.

    The program interface is developed using the form designer. In order for the program to be executed, the source texts are translated into machine language. This is done by the compiler, which also feeds into the programming system.

    Without leaving the Visual Basic environment, you can run your program multiple times, checking and debugging its operation, and return back.

    Thus, the program can be either in design mode or in execution mode.

    The finished program is saved as an executable file (exe module), which can work in the absence of the source text. The compiler creates it. Interpreters differ from compilers in that they “translate” and execute the program line by line.

    Objects and their properties

    To create an interface, Visual Basic provides ready-made objects that have certain properties that can be changed to customize the program to perform a specific task.

    To create means of communication with the user, the project includes forms, which are typical Windows windows. They have a title bar with control buttons and a system menu, as well as mouse control capabilities. All this does not need to be programmed; the form included in the project has these properties. The empty surface of the form (gray background covered with mesh) is filled in during the design process. Visual Basic immediately adds one form to a new project, which is displayed in the center of the screen, in the form window.

    Form properties include, for example, its title and dimensions. In addition to forms, you have a set of control elements at your disposal. Each of them performs certain, already programmed functions. One is a work area for entering and editing text, the other is for displaying pictures, etc. During the design process, you select the elements you need and place them on the form.

    Standard Visual Basic Project

    The source code of a Visual Basic program is saved in several files.

    The project file has a .vbp extension and contains a registry of files needed to create the application executable file.

    The form module stores a description of the form and its control elements and the program code related to them. This is a regular text file with a .frm extension. There can be several such modules in a project, depending on the number of forms.

    Code not associated with a specific form or control is placed in a standard module with a .bas extension. There may be modules of other types.

    Selecting a Project Type

    When you call Visual Basic, the Project Wizard dialog box opens. It has 3 tabs with the following purposes:

    New - creating a new project, there are several standard templates to choose from; to create your first application, select Standard EXE.

    Existing - open an existing project, allows you to select a file in the selection dialog.

    Recent - open one of the most recent projects that were created or to which any changes were made.

    Brief description of IDE (Integrated Development Environment)

    A Visual Basic window contains a menu bar, toolbars, and various windows. The form designer window is located in the center of the screen and contains a form. By default, a form named Form1 is added to the new project. The Object command of the View menu opens a window if it was closed and displays it on top of other windows.

    A window with a collection of control elements (ToolBox) is usually located to the left of the form. It contains a set of standard control elements. During the design process, you select the necessary elements and move them to the form.

    The Properties window contains a list of properties and their values ​​for the selected object. The object can be selected here in the list under the title bar.

    The Project Explorer window displays all the components of the project: forms and modules. There are also buttons for switching between the form window and the editor.

    The Code editor window contains the program text.

    The Form1 Layout window shows what the current form will look like on screen at run time.

    Windows are docked to each other (Docking). To undock a window, double-click the title bar or simply move it. To dock a window, move it to the border and release the mouse button. You can move the borders between docked windows and resize them. Any of the windows can be removed from the screen and brought back at the right time using the View menu commands or buttons on the toolbar.

    Visual design

    Start a new project. Make sure the form is a selected object and the Properties window displays its properties. Change the title of the form. To do this, find the Caption property in the list of properties, double-click it and enter the title text. Change the color of the form using the BackColor property.

    The Left and Top properties determine the position of the form on the screen when the program is launched for execution. These are the coordinates of the upper left corner of the form in twips (1-1440 logical, i.e. depending on the resolution of the monitor, inches.)

    To change, you can enter new values ​​from the keyboard or move the form image in the Form Layout window with the mouse. At runtime, you can move the form like a normal Windows window, but this does not affect the value of the Left and Top properties.

    The values ​​of the Height and Width properties are the height and width of the form, respectively. You can change these values ​​by using the mouse to resize the shape in design mode. If the size of the form becomes larger than the size of the window with the form in design mode, then scroll bars appear. Changing sizes while the program is running does not affect the values ​​of the properties.

    Naming convention

    In the program, each form and each control element has its own unique name by which they can be accessed. Default names are given by the system when creating an object and consist of a word indicating the type of object and a number - a serial number. For example, the first form in the project is named Form1. The name of an object in a program is the value of the Name property of that object, and this property is often modified to give the object a name that reflects its purpose in the program. Visual Basic does not impose any serious restrictions on names - they can be almost anything, but there are generally accepted conventions (Hungarian notation) for the formation of names. In Hungarian notation, the name of an object begins with a short prefix, which is standard for objects of this kind and describes the type or scope. The prefix is ​​followed by the actual name of the object, reflecting its purpose, with the first character of the name capitalized, for example, the form frmDefault.

    If the name is made up of several words, then each of them begins with a capital letter, for example, frmTextEditor.

    But there are some restrictions in choosing a name. The variable name must: start with a letter, not contain a period, be no more than 255 characters, not match Visual Basic keywords, and be unique within the scope.

    Do you want to create your own program, but do not have special skills? Thanks to visual environments, programming has become accessible to all users of electronic devices.

    More recently, visual environments were primitive and had limited functionality, in contrast to integrated ones based on working with languages. But digital technologies do not stand still, and today we have access to powerful tools that can replace code with a user-friendly interface.

    The principle of visual programming

    The basics of visual environments are based on the same programming language, but unlike an IDE, you don’t need to write it yourself. The process of creating a program consists of manipulating blocks (their designation and connection in a serial circuit). The universal capabilities of visual environments allow you to embody the most unusual ideas and significantly speed up the creation process.

    To make it easier for you to choose the right program, we have collected the best tools in a single archive. Choose and download your visual programming environment via torrent or file sharing services (MEGA or Yandex.Disk).





    

    2024 gtavrl.ru.