Download Component writer's guide : Borland Delphi for Windows 95 and PDF

Read Online or Download Component writer's guide : Borland Delphi for Windows 95 and Windows NT : version 2.0 PDF

Best programming: programming languages books

Fortran 90 for Fortran 77 programmers

The good fortune of Fortran because the principal programming language within the box of clinical and numerical computing is due, partially, to its regular evolution. Following the book of criteria in 1966 and 1978, the committee accountable for their improvement, X3J3, labored along with an ISO committee to increase a customary compatible to be used within the 1990's and past.

Additional resources for Component writer's guide : Borland Delphi for Windows 95 and Windows NT : version 2.0

Example text

2-4 Component Writer’s Guide Controlling access Hiding implementation details Declaring part of a class as private makes that part invisible to code outside the class’s unit file. Within the unit that contains the declaration, code can access the part as if it were public. The following example shows how declaring a field as private hides it from application developers. The listing shows two VCL form units. Each form has a handler for its OnCreate event which assigns a value to a private field.

For example, all the key events (OnKeyDown, OnKeyUp, and OnKeyPress) pass by reference the value of the key pressed in a parameter named Key. The event handler can change Key so that the application sees a different key as being involved in the event. This is a way to force typed characters to uppercase, for example. 4-8 Component Writer’s Guide Defining your own events Declaring the event Once you have determined the type of your event handler, you are ready to declare the method pointer and the property for the event.

Implementing the standard events • Defining your own events Events are implemented as properties, so you should already be familiar with the material in Chapter 3, “Creating properties,” before you attempt to create or change a component’s events. What are events? An event is a mechanism that links an occurrence to some code. More specifically, an event is a method pointer that points to a method in a specific class instance. From the application developer’s perspective, an event is just a name related to a system occurrence, such as OnClick, to which specific code can be attached.

Download PDF sample

Rated 4.10 of 5 – based on 23 votes