LC++ programming in Windows environment Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./0. lThe Visual Component Library.

Slides:



Advertisements
Similar presentations
Interaction Design: Visio
Advertisements

Microsoft ® Office Outlook ® 2007 Training Retrieve, back up, or share messages Sweetwater ISD presents:
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Chapter 12 Creating and Using Templates. If you have already created and designed a page you like, you can use the layout and design for other pages in.
The Web Warrior Guide to Web Design Technologies
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Using the Visual Basic Editor Visual Basic for Applications 1.
ArcView Documents Francisco Olivera, Ph.D., P.E. Department of Civil Engineering Texas A&M University.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
File Management and Organisation © Copyright William Rowan 2007.
Access Tutorial 10 Automating Tasks with Macros
Lesson 9 Windows Management
PowerPoint Lesson 4 Expanding on PowerPoint Basics
A First Program Using C#
UBUNTU - Desktop Panel by default is across the top Applications menu Quick Launch icons Notification area Clock Shut Down Task Bar by default is on the.
Using Dreamweaver. Slide 1 Dreamweaver has 2 screens that do different things The Document window where you create your WebPages The Site window where.
XP New Perspectives on Introducing Microsoft Office XP Tutorial 1 1 Introducing Microsoft Office XP Tutorial 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
CIS 338: Creating ActiveX Controls Dr. Ralph D. Westfall March, 2003.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
BZUPAGES.COM Visual Programming Lecture – 5 Miss. SADAF MAJEED SIAL Computer Science Department Bahauddin Zakariya University Multan.
Lecture Set 2 Part B – Configuring Visual Studio; Configuration Options and The Help System (scan quickly for future reference)
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
MFC Windows Programming: Document/View Approach More detailed notes at: 360/notes-html/class15.htm.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
OCC Network Drives  H:\  P:\ 
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Teach Yourself Windows 95 Module 4: Using Microsoft Exchange for Faxes and .
Using Xcode A Beginner’s Tutorial Erin Green. This tutorial will walk you through Xcode, a software development tool for Apple’s iOS applications – We.
Lection №5 Modern integrated development environment.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
® Microsoft Access 2010 Tutorial 10 Automating Tasks with Macros.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Java Beans. Definitions A reusable software component that can be manipulated visually in a ‘builder tool’. (from JavaBean Specification) The JavaBeans.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
Class Builder Tutorial Presented By- Amit Singh & Sylendra Prasad.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
Oracle Forms Oracle Forms Builder provides various tools, which have powerful Graphical User Interfaces (GUI's) to design such forms. All objects, properties,
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
Overview of Previous Lesson(s) Over View 3 Program.
Understanding Desktop Applications Lesson 5. Understanding Windows Forms Applications Windows Forms applications are smart client applications consisting.
© 2010 Delmar, Cengage Learning Chapter 11 Creating and Using Templates.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Chapter 2 – Introduction to Windows Operating System II Manipulating Windows GUI 1CMPF112 Computing Skills for Engineers.
Microsoft Foundation Classes MFC
Creating a Flash Web Site
Forms Concepts Triggers Fired when Internal/External events occur
Creating a Basic Form Module
Developer 2000 CSE 4504/6504 Lab.
1. Introduction to Visual Basic
Understand Windows Forms Applications and Console-based Applications
Lesson 9 Windows Management
CIS16 Application Development Programming with Visual Basic
C++ programming in Windows environment The Borland C++ Builder
C++ programming in Windows environment
Lecture Set 11 Creating and Using Classes
The Basic Usage and The Event Handling in Glade.
C++ programming in Windows environment
Presentation transcript:

lC++ programming in Windows environment Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./0. lThe Visual Component Library (VCL) lStructure of VCL lBuilding elements of the program: the components lApplication models handling single, or multiple documents (SDI, MDI) lProject handling of C++ Builder The Borland C++ Builder lThe first steps of making an application

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./1. lBuilding elements of the program: the components The component is such an object (e.g. a button) that works already during planning, writing the program, consequently the values of its properties can be set without writing program code. From a lot of pre-programmed components realising given task the exactly required instance can be selected for the program. The components can easily be put on the form of designed window selecting them from the component- palette.

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./2. The event is an occurrence, e.g. a button click by mouse, that comes from the user interaction or the Windows operating system. The list of events that can happen on a selected component (e.g. button) is given in the Events page of the Object Inspector. The handling of an event is performed by the event handler function of the component. The event handler is that among the member functions of the component affected by the event which starts to run because of the event and answers it (e.g. closes the window). The skeleton of the event handler function can be created in the program double clicking on the name of the selected event in the Events page. The internal code of the function that answers to the occurrence has to be written by us.

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./3. Double click on the name of the event and the skeleton of the event handler is ready. The answering code has to be entered here by you!

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./4. The components have non event handler member functions too, these functions are the methods. The methods can be called by us too in the code segment written by us. Among the methods there are the constructor and the destructor. E.g. the calling of the Focused() method answers the question is the control component in focus, so it is selected for getting the effects originate from the user actions. In the working program the control which is in the focus is set off using framing, colouring or another method. In case of Properties, Events and Methods the Help informs us about the ancestor class where these characteristics were defined the first time, where they are inherited to the class of the object from.

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./5. The Help gives detailed information about properties of every single class. Because of its complexity the C++ Builder is practically not usable without the online Help. Program examples support the understanding and applying of components. A tutorial is included for beginners in the Help/C++ Builder Help/Contents/ Quick Start: Tutorials point. Example programs that introduce the possibilities of C++ Builder are in the Examples folder.

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./6. As C++ Builder is suitable for writing programs that run on Windows graphical operating system and use the resources of Windows API, it is evident that includes a graphical object library which uses and simultaneously hides the API. The visual attribute means that these objects mostly displayed on the screen: window-forms, menus, input panels, controls, etc. For non visual objects an example is the timer. VCL classes are organised into a class hierarchy. The C++ Builder borrowed this structure from the Borland Delphi program development environment, that uses the Object Pascal programming language. The VCL provides the components to a quick build-up of Windows-style user interface but the internal program code that gives the essence of the application has to be entered using C++ language. The capabilities of Object Pascal based VCL have the next differences compared to possibilities of C++: The VCL objects have to be created dynamically (new, delete) The member functions of VCL objects have not default parameter values The VCL objects cannot have multiple ancestors. lThe Visual Component Library (VCL)

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./7. lStructure of VCL (detail) TObject TPersistent TComponent TControl TStream TGraphic TStrings TApplication TMenu TGraphicControl TWinControl TScrollingWinControl TCustomControl TCustomForm TImage TShape TForm TButtonControl TButton

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./8. TObject is the ancestor of VCL classes. The descendants of TPersistent class can save and load their features to/from files. TComponent is the ancestor of components. Their descendants have properties and methods that make possible to install them into the Component Palette and to add them to forms. TControl is the ancestor class of controls appearing in the user interface. The instances of TApplication class are the applications. It has methods like Initialize(); CreateForm(); Run(); for control of the application and to handle the message transmitting cycle. They are called in WinMain() function. TForm is class of windows, the main window of the application, the dialog windows of the user interface are derived from it. The structure, the parts of the built window are included in the.DFM file, the program code regarding its work is in the.CPP file and the declarations are given in the.H header file. The programmer don’t have to deal with the.DFM file, its creation is automatic. Custom classes can constitute the basis class of classes built further from them by the programmer. These new classes are not given in the class hierarchy originally.

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./9. lApplication models handling single, or multiple documents (SDI, MDI) The applications can be of two sorts: The SDI, Single Document Interface program can use countless further dialog and message windows over the main window, but can work on one document only. The MDI, Multiple Document Interface program can run countless further document windows in the main window that have the same structure and can display different documents. The menus and icons in the main window refers to the active document. E.g. remember the Windows/Tile function of Excel. The application model of the main window of our application can be selected by the FormStyle property of its form. The document windows of an MDI application are non modal windows: more than one can be opened at the same time, every can be selected clicking in it and can be used for work. Such windows have to be displayed calling their Show() method. Modal windows have to be closed before clicking effectively in another window of the application. Such windows applied in every application model: most of the dialog windows are such. This behaviour is caused by the ShowModal() method.

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./10. lProject handling of C++ Builder The C++ Builder development environment administers the files created during developing process hidden in the project file (e.g. football.bpr). The starting file including the WinMain() function is made automatically. (e.g. FOOTBALL.cpp).

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./11. The units consist of a.cpp and a.h pair of files. In case of forms this pair is completed with a.dfm form-definition file that is made automatically. The Project Manager does not show the.h header files. The.res resource file and other, rare used files (.txt,.bmp,.wav) can be attached to the above mentioned files.

Department of Information Engineering INFORMATION TECHNOLOGY dr. László Dudás 10./12. lThe first steps of making an application 1. Create a new folder which will store the files of the project. 2. Start C++ Builder. 3. If a previous project were open choose the File/Close all menu item and close it.  Then create a new project with the File/New Application menu point. The C++ Builder creates the next files automatically:   Project1.cpp : the main program   Unit1.cpp : the source code file for the main form that is named unit file   Unit1.h : the header file for the main form that is named unit header file   Unit1.dfm : resource file that describes the structure of the main form. 4. Choose the File/Save All menu item and save the files to the previously created folder. Rename the.bpr project file to taste during saving. The default names of units can be kept or renamed at will. 5. Later the full project has to be saved by the File/Save All menu item. This is expedient after every bigger modification.