1 / 18

Delphi 4

Delphi 4. Introduction to IDE Overview of Delphi Programs Visual Programming. Overview of I ntegrated D evelopment E nvironment. Using Delphi from Windows Main window Form Designer Window Object Inspector Window Code Editor Window Project Manager Creating a Delphi project.

xannon
Download Presentation

Delphi 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Delphi 4 Introduction to IDE Overview of Delphi Programs Visual Programming

  2. Overview of Integrated Development Environment • Using Delphi from Windows • Main window • Form Designer Window • Object Inspector Window • Code Editor Window • Project Manager • Creating a Delphi project

  3. Main Window • Menu Line • Toolbar • Left: Speed buttons for Menu commands • Right: Component palette • Components which can be chosen to insert into the user interface you are designing. • You insert components into the Form Designer Window (right hand window)

  4. Object Inspector Window:Properties Page Properties: Attributes of component, e.g. • Caption -- text for title bar • Enabled -- mouse and keyboard input • WindowState -- initially displayed maximized, minimized, or normal • Active Control -- which visual component initially has the focus (user can tab or use mouse to change)

  5. Object Inspector: Events Page Event: user input (e.g. user selects the component) • Double click an event -- e.g. OnClick • Write the code to handle that event in the skeleton procedure provided in the Code Editor Window

  6. Saving and Running a Delphi Project • Save each Form unit with an appropriate name (PAS is automatic extension for the code file, DFM for visual resources automatically saved) • Save Project (DPR is automatic extension for the project module) • Compile & Run (DCU files created for units, EXE file created for program)

  7. Programs and Units • Main program. • Units • Interface -- defines data and subprograms available to client units and program • Implementation -- local variables for unit and detailed implementation of subprograms

  8. Object-Oriented programming • Class: a type, which contains data and methods(operations) associated with that data. • Descendent Class: a type which inherits data and methods from its ancestor class. • Object: an instance of a class (variable declared as that type)

  9. Controlled Access to Data and Methods of a Class TClassName = Class public {data and methods available to instances and descendent classes} protected {those available to descendent classes, not to instances} private {those not available to either} end;

  10. Visual Programming • Form design • Object-oriented code generation • Event-driven programming • Components • Secondary Forms • Modal dialog boxes • Modeless dialog boxes

  11. Form Design and Code Generation • You begin with a main form; Delphi generates • main program • skeleton declaration of descendent class for main form • You select and position components; Delphi generates • classes as fields of main form

  12. Event Driven Programming Flow of control is in hands of user -- by mouse and keyboard events. • For a chosen component, you double-click on one of its event handlers. • Delphi generates • a method in the form class in interface • a skeleton method in implementation • You supply code in event handler.

  13. Components: Toolbars Several groups of components are available: • Standard • Additional • two database groups • Dialogs • System

  14. Notable Standard Components • menus • Label • EditBox (single line input) • Memo (multiple line input) • Button • CheckBox (yes/no on each choice) • ListBox (scrollable list -- select one) • ScrollBar

  15. Other Notable Components • Additional • BitButton • SpeedButton • StringGrid • Dialogs • OpenDialog, SaveDialog (for file speed button) • System • Timer (invisible -- triggers timed event)

  16. Component Classes • Windowed -- inherit Microsoft Windows controls, can have focus, e.g. • TForm • TMemo • Non-windowed, e.g. • TLabel • Non-Visual, e.g. • TTimer

  17. Secondary Forms Select File|New Form to generate. (Note: a new unit is generated for each form.) • Modeless dialog boxes • user can click outside the box • Modal dialog boxes • must be closed before user can access other pre-existing windows • include call to dialog box’s ShowModal method in its button click handler

  18. Assignment • Begin exploring Delphi 4, using • on-line documentation • Quick Start • Optional “Teach Yourself Delphi 4 in 21 Days” • Create a project of your choosing to show what you learned this week. • Turn in • source code listing • executable code on disk

More Related