
Visual Component Library Reference Delphi for Windows Introduction Copyright Agreement This manual is a reference for the Delphi Visual Component Library (VCL) and the Delphi run-time library. Use it when you want to look up the details of a particular VCL object, component, variable, property, method, event, routine, or type and find out how to use it. Note See online Help for documentation of the Object Pascal Language Definition and Reference. Manual conventions The printed manuals for Delphi use the typefaces and symbols described in Table Intro.1 to indicate special text. Table Intro.1 Typefaces and symbols in these manuals Typeface or symbol Meaning Monospace type Monospaced text represents text as it appears onscreen or in Object Pascal code. It also represents anything you must type. Boldface Boldfaced words in text or code listings represent Object Pascal reserved words or compiler directives. Italics Italicized words in text represent Object Pascal identifiers, such as variable or type names. Italics are also used to emphasize certain words, such as new terms. Keycaps This typeface indicates a key on your keyboard. For example, “Press Esc to exit a menu.” This symbol indicates a key, or important property, method, or event. This symbol indicates a run-time only property, method or event. Contacting Borland The Borland Assist program offers a range of technical support plans to fit the different needs of individuals, consultants, large corporations, and developers. To receive help with this product send in the registration card and select the Borland Assist plan that best suits your needs. North American customers can register by phone 24 hours a day by calling 1-800-845-0147. For additional details on these and other Borland services, see the Borland Assist Support and Services Guide included with this product. Introduction 1 Delphi Visual Component Library The VCL is made up of objects, most of which are also components. Using the objects and components of VCL, you are unlimited in the range of Windows programs you can develop rapidly. Delphi itself was built using VCL. Delphi objects contain both code and data. The data is stored in the fields and properties of the objects, and the code is made up of methods that act upon the field and property values. All objects descend from the ancestor object TObject. Components are visual objects that you can manipulate at design time. All components descend from the TComponent object. To program with a component, this is the model you will use most frequently: 1 Select a component from Delphi’s Component palette and add it to a form. 2 Set property values of the component using the Object Inspector. 3 Respond to events that might occur to the component at run time. To respond to an event, you write code within an event handler. Your code modifies property values and calls methods. For detailed information on how to perform these three steps, see the Delphi User’s Guide. You can create your own objects and components by deriving them from the existing Delphi objects and components. For information about writing your own components, see the Delphi Component Writer’s Guide. Visual Component Library objects Objects are the fundamental elements of the VCL. In fact, all components and controls are based on objects. Objects differ from controls in that you can access them only at run time. Unlike most components, objects do not appear on the Component palette. Instead, a default instance variable is declared in the unit of the object or you have to declare one yourself. For example, the Clipboard variable is declared in the Clipbrd unit. To use a TClipboard object, add the Clipbrd unit to the uses clause of the unit, then refer to the Clipboard variable. However, to use a TBitmap object, add the Graphics unit to the uses clause of the unit, then execute the following code at run time to declare an instance variable: var Bitmap1: TBitmap; begin Bitmap1 := TBitmap.Create; end; Note The memory allocated for objects that you explicitly declare should be released when you are finished with the object. For example, call the Free method of the bitmap: Bitmap1.Free; 2 Delphi Visual Component Library The properties, methods, and events that all objects have in common are inherited from an abstract object type called TObject. You need to understand the internal details of TObject only if you are creating a new object based on TObject. The following is a list of all objects in the VCL that directly descend from TObject.: Table Intro.2 VCL objects TBitmap TGraphic TOutlineNode TBlobStream TGraphicsObject TParam TBrush TIcon TParams TCanvas TIndexDef TPen TClipboard TIndexDefs TPicture TControlScrollBar TIniFile TPrinter TFieldDef TList TStringList TFieldDefs TMetafile TStrings TFont TOLEDropNotify Note In addition to these objects, all VCL components also descend from TObject, although not directly. The TObject object introduces the following methods that all objects and components inherit: Table Intro.3 Object methods ClassName ClassType Destroy ClassParent Create Free Visual Component Library components Components are the building blocks of Delphi applications. You build an application by adding components to forms and using the properties, methods, and events of the components. The properties, methods, and events that all components have in common are inherited from an abstract component type called TComponent. You need to understand the internal details of TComponent only if you are writing a component based on TComponent. The following is a list of all components in the VCL: Table Intro.4 VCL components TApplication TDDEClientItem TOutline TBatchMove TDDEServerConv TPaintBox TBCDField TDDEServerItem TPanel TBevel TDirectoryListBox TPopupMenu TBitBtn TDrawGrid TPrintDialog TBlobField TDriveComboBox TPrinterSetupDialog TBooleanField TEdit TQuery Introduction 3 Table Intro.4 VCL components (continued) TButton TField TRadioButton TBytesField TFileListBox TRadioGroup TCheckBox TFilterComboBox TReplaceDialog TColorDialog TFindDialog TReport TComboBox TFloatField TSaveDialog TCurrencyField TFontDialog TScreen TDatabase TForm TScrollBar TDataSource TGraphicField TScrollBox TDateField TGroupBox TSession TDateTimeField THeader TShape TDBCheckBox TImage TSmallIntField TDBComboBox TIntegerField TSpeedButton TDBEdit TLabel TStoredProc TDBGrid TListBox TStringField TDBImage TMainMenu TStringGrid TDBListBox TMaskEdit TTabbedNotebook TDBLookupCombo TMediaPlayer TTable TDBLookupList TMemo TTabSet TDBMemo TMemoField TTimeField TDBNavigator TMenuItem TTimer TDBRadioGroup TNotebook TVarBytesField TDBText TOLEContainer TWordField TDDEClientConv TOpenDialog Most components are available from the Component palette. You will not find the following components on the Component palette, however: Table Intro.5 Components not on the Component palette TApplication TDateTimeField TScreen TBCDField TField TSession TBlobField TFloatField TSmallIntField TBooleanField TGraphicField TStringField TBytesField TIntegerField TTimeField TCurrencyField TMemoField TVarBytesField TDateField TMenuItem TWordField The TComponent component introduces the following properties that all components inherit: Table Intro.6 Component properties ComponentCount Components Owner ComponentIndex Name Tag 4 Delphi Visual Component Library In addition to the methods components inherit from the TObject object, the TComponent component introduces the following: Table Intro.7 Component methods FindComponent InsertComponent RemoveComponent Visual Component Library controls Controls are visual components; that is, they are components you can see when your application is running. All controls have properties in common that specify the visual attributes of controls, such as Left, Top, Height, Width, Cursor, and Hint. The properties, methods, and events that all controls have in common are inherited from an abstract component type called TControl. You need to understand the internal details of TControl only if you are writing a component based on TControl. The following is a list of all controls in the VCL. Table Intro.8 VCL controls TBevel TDBText TNotebook TBitBtn TDirectoryListBox TOLEContainer TButton TDrawGrid TOutline TCheckBox TDriveComboBox TPaintBox TComboBox TEdit TPanel TDBCheckBox TFileListBox TRadioButton TDBComboBox TFilterComboBox TRadioGroup TDBEdit TForm TScrollBar TDBGrid TGroupBox TScrollBox TDBImage THeader TShape TDBListBox TImage TSpeedButton TDBLookupCombo TLabel TStringGrid TDBLookupList TListBox TTabbedNotebook TDBMemo TMaskEdit TTabSet TDBNavigator TMediaPlayer TDBRadioGroup TMemo In addition to the properties controls inherit from the TComponent component, the TControl component introduces the following: Table Intro.9 Control properties Align Cursor ShowHint BoundsRect Enabled Top ClientHeight Height Visible ClientOrigin Hint Width ClientRect Left ClientWidth Parent Introduction 5 In addition to the methods controls inherit from the TComponent component, the TControl component introduces the following methods: Table Intro.10 Control methods BeginDrag GetTextBuf Repaint BringToFront GetTextLen ScreenToClient ClientToScreen Hide SetBounds ControlAtPos Invalidate SetTextBuf Dragging Refresh Show EndDrag SendToBack Update Visual Component Library windowed controls Windowed controls are controls that: • Can receive focus while your application is running • Can contain other controls • Have a window handle All windowed controls have properties in common that specify their focus attributes, such as HelpContext, TabStop, and TabOrder.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages1072 Page
-
File Size-