Copyright: Copyright (c) 1997 Corel Corporation


Corel Paradox Add-Ins

A Corel Paradox add-in is an external DLL that you or another third-party developer has provided.

Corel Paradox 8 lets you use menus and forms of the add-in within the Corel Paradox Desktop environment. By calling methods of the ObjectPAL AddinForm type, you can open and close add-in forms, set and get published properties, manipulate the add-in and call its routines from Corel Paradox.

Not all DLLs can be used in Corel Paradox as add-ins. To use an add-in in Corel Paradox, it must be designed to allow communication flow between it and Corel Paradox. If you are using Borland Delphi to create a Corel Paradox add-in, see Creating a Corel Paradox add-in DLL using Delphi. and About the Corel Paradox Add-In Development Kit. If you want more information on creating Corel Paradox add-ins using any language capable of generating COM-based interfaces, see About COM interface applications.


About Borland Delphi

Delphi combines the rapid application development (RAD) productivity of visual tools and reusable components. You can easily create your own reusable components, or use any of the ones included to develop full applications or front ends for other applications.


About the Paradox Add-In Development Kit for Delphi
About the Corel Paradox Add-In Development Kit for Delphi

The Corel Paradox Add-In Development Kit for Delphi, designed for use with Delphi 2.0 or later, is a group of Delphi components that extends the Corel Paradox environment using Delphi. The Corel Paradox Add-In Development Kit makes it easy for developers to

•	create Delphi forms that can be used in Corel Paradox

•	attach menu options to Corel Paradox menus

The Corel Paradox Add-In Development Kit includes ready-to-use add-in interface components that allow communication flow between your add-in and Corel Paradox.

You don't have to use the Corel Paradox Add-In Development Kit for Delphi to create a Corel Paradox add-in. However, if you choose to develop your add-in using C++ (or any other language that generates COM-based or OLE-based interfaces), you must create the necessary add-in interfaces yourself. For information on these interfaces, see Add-In interface specifications.

The only Delphi component essential to writing Corel Paradox add-ins is the Corel Paradox component TParadoxAddIn (Unit PdxAddin). However, there are several other components in the Corel Paradox Add-In Development Kit that can make developing a Corel Paradox add-in much easier.

Click any of the components listed below for more information:

•	PdxAddin Unit

•	PdxDeskW Unit

•	PdxForms Unit

•	dbClone Unit

For information on the components inter-relationship and their relationship with Corel Paradox, see Overview of Delphi source files.


Overview of Delphi source files

The tables below present the relationship between the Delphi components and Corel Paradox.

The following table provides an overview of Delphi source code included with the add-in component files and its relationship to Corel Paradox.

File	Purpose	How to use
PdxForms.pas	Makes Delphi forms functional in the Corel Paradox environment by making them a desktop child window and enabling MDI support for a non-Delphi parent.	Add to the Uses clause in your form definition units, and replace "Tform" with "TParadoxForm" (defined in this unit).
PdxAddIn.pas	Provides communication with Corel Paradox via the "Corel Paradox" object. Supports registration of menus and forms. Provides access to the Desktop window, status bar, and services.	Add to the Uses clause only if you need to talk directly to Corel Paradox (via the "Corel Paradox" object). Used by PdxForms and PdxDeskW.
PdxDeskW.pas	A convenient, visual way to build and register menu items to be placed on the Corel Paradox main menu.	Add a copy to your project, then customize the pop-up menus to place items on the Corel Paradox menu.
PdxDeskW.dfm	Supports PdxDeskW.pas.	Automatic.
IAddin.pas	Pure interface definition between Corel Paradox and Delphi. Used to keep both sides in sync.	Automatic.
UAddin.pas	The implementation of the interface between Corel Paradox and Delphi.	Automatic.
DbClone.pas	Provides support for working with BDE handles provided by Corel Paradox.	Register as a component (or create on the fly). Take BDE handles provided by Corel Paradox and use to clone a cursor.


Configuring Delphi to use the Paradox Add-In Development Kit
Configuring Delphi to use the Corel Paradox Add-In Development Kit

Once you have installed the Corel Paradox Add-In Development Kit, you have to add it to the Delphi search path and add the desired components to the Delphi New Items palette.

To add the Corel Paradox Add-In Development Kit to the Delphi search path

1.	Start Delphi.

2.	Click Project, Options.

3.	Click the Directories/Conditionals tab.

4.	In the Search Path box, type the following path: C:\COREL\SUITE8\PARADOX\ADDINS. Use a semicolon (;) to separate individual paths.


Creating a Paradox add-in DLL using Delphi
Creating a Corel Paradox add-in DLL using Delphi

In Delphi, a DLL is considered a project. When you create a new Corel Paradox add-in DLL, Delphi copies all the needed support files to the directory you've specified for your project. You can create a completely new project, or you can use an existing project and convert it into a Corel Paradox add-in.

To create a new Corel Paradox add-in project

1.	From the Delphi desktop, click File, New.

2.	In the New Items dialog box, click the DLL icon.

3.	Create your DLL as required.

To convert an existing DLL written in Delphi into a Corel Paradox add-in

1.	Open the DLL project. If the project source isn't displayed, click View, Project Source.

2.	Add the PdxAddIn unit to the Uses clause of the DLL. (See PdxAddIn in the Uses clause for more information.)

3.	Convert the forms (see Using existing Delphi forms) and register them (see Add-in registration).

4.	Register any menu items. If you add the Corel Paradox Desktop form to your project, registration of menu items is done for you (see The virtual Corel Paradox Desktop). You can also call the registerMenu procedure (see TParadoxAddIn component (Unit PdxAddin).)


Adding menus to the Corel Paradox Desktop

If you created your Corel Paradox add-in DLL project following the instructions in Creating a Corel Paradox add-in DLL in Delphi, your project already contains a form named PdxDeskW. This is the Corel Paradox Desktop that you can use to add menu items to the real Corel Paradox Desktop.

To add menu items to the virtual Corel Paradox Desktop

1.	Click View, Forms.

2.	Choose f_ParadoxDesktop.

Although the virtual Corel Paradox Desktop window doesn't look like the real Corel Paradox Desktop, all the Corel Paradox menus to which you can add menu items are represented.

3.	Double-click the icon for the menu to which you want to add options.

4.	In the Delphi menu editor, add the menu options you want.

You can modify the menu item properties at run time and see the effects in Corel Paradox. Setting the menu item's Visible property to False removes it from the Corel Paradox menus.

5. Attach code to the OnClick event for each custom menu option.

Forms that you display from a menu option should be descended from TParadoxForm. For more information, see Using existing Delphi forms.


Associating forms with menu options

Once you've created your forms, displaying them from a menu option is easy. The code you'd need to display a form from a custom Corel Paradox menu option is the same as the code you'd use in a similar situation in Delphi. For example, the code to open a modal form from a menu option might look like this one:

Procedure Tf_ParadoxDesktop.MyAddinClick(sender:TObject);

Var MyForm :TMyForm;

Begin

  MyForm := TMyForm.Create(Application);

  With MyForm do

    Begin

      Wait;

      Free;

    End;

End;

In the above example, Tf_ParadoxDesktop is the virtual Corel Paradox Desktop component. MyAddinCick is the event handler for the add-in menu item and MyForm is the Delphi add-in form that is descended from TParadoxForm.

Example code that opens a non-modal form from a menu option might look as follows:

Procedure Tf_ParadoxDesktop.MyAddinClick(sender:TObject);

Var MyForm :TMyForm;

Begin

  MyForm := TMyForm.Create(Application);

  MyForm.Show;

End;


Using Delphi's published properties

Published properties are those that are listed in the Delphi Object Inspector.

To use Delphi published properties in your add-in, set your add-in forms to descend from TParadoxForm. (See Using existing Delphi forms for information.)

To add your own custom properties, see Adding custom properties.


Adding custom properties

To add custom properties to your add-in, include them in the PUBLISHED section of your form declaration. For an example of an added custom property, see Example: Adding custom properties.

The following restrictions apply to custom properties:

Property data types

Corel Paradox can only access properties that are integers, enumerations, strings, sets, or floating point numbers.

Enumerations

Enumerations can be accessed by name or number, but only true enumerated names will work as expected. For example, from ObjectPAL you can execute

AF.SetProperty("FormStyle", "fsNormal")

where AF is an assigned AddinForm variable. This will work as expected. However, the following code will fail because clWindow is not a true enumerated name:

AF.SetProperty("Color", "clWindow")

In some cases, you can use ObjectPAL constants. In the above example, you can use the ObjectPAL constant clWindow, as ObjectPAL uses the associated value for clWindow instead of the constant name. The code then reads:

AF.SetProperty("Color", clWindow)

If there is no corresponding ObjectPAL constant, you must use the numeric value.

Delphi "Set" values must be accessed as strings

To set and get Delphi "Set" values, the value names must be strings. For example:

AF.SetProperty("Font.Style","[fsBold,fsUnderline]")

Properties that are also objects

Properties that are themselves objects can be accessed only as intermediate results. For example, the following code will work:

AF.GetPropertyAsInteger("Memo.Font.Color")

But the following two examples are incorrect and will not work:

AF.GetPropertyAsInteger("Memo.Font")

AF.GetPropertyAsInteger("Memo")

Properties must be published

Properties must be published to be accessible from ObjectPAL. For example, you cannot execute a setProperty call as follows:

AF.SetProperty("Memo.Lines.Text", "")

You can't execute the call because "Text" is not a default published property of a TStrings object. You need to define a new property, called "MemoText" for example, and use it in order to set this property.


Example: Adding custom properties

The following code defines a new custom property called MemoText:

Type TMyForm = class(TParadoxForm)

  Memo1 :TMemo;

  …

Published

  Property MemoText:String read getMemoText write setMemoText;

  Procedure setMemoText( newValue:String );

  Function getMemoText :String;

End;

…

Procedure TMyForm.setMemoText( newValue:String );

Begin

  Memo1.Lines.Text := newValue;

End;

Function TMyForm.getMemoText :String;

Begin

  Result := Memo1.Lines.Text;

End;


Sharing data

Your Delphi add-in can share data with Corel Paradox. The ObjectPAL TCursor handle method returns the BDE handle for the cursor. This can be passed in a function (or form property) to the Delphi add-in, which can use the provided TCursorTable component to work with the cursor handle.

Conversely, Delphi’s TTable and TQuery components have a Handle property that you can pass to Corel Paradox (through the result of a function call or a form property). Then you can use TCursor::attach(handle) to clone the cursor inside Corel Paradox.

The TCursorTable component can be found in DBCLONE.PAS.


Parent/child window relationship

Setting all Corel Paradox add-in forms (even modal forms) to descend from TParadoxForm ensures a correct parent/child relationship between the Corel Paradox Desktop window and your Delphi add-in form. It prevents problems, such as your add-in form slipping behind the Corel Paradox Desktop window, for example, or appearing at the wrong coordinates.


Using existing Delphi forms

To use an existing Delphi form in your Corel Paradox add-in, you have to set your form to descend from TParadoxForm.

To use an existing Delphi form in your Corel Paradox add-in

1.	Find the following line in your Delphi source code:

TForm1=class(TForm)

2.	Change the line to:

TForm1=class(TParadoxForm)

3.	Include the PdxForms and PdxAddin units in the Uses clause of your Delphi code so that your Delphi form compiles properly.(See PdxAddIn in the Uses clause for more information).

For more information on TParadoxForm, see PdxForms Unit.


PdxAddIn in the Uses clause

To create a Delphi form that is descended from TParadoxForm, you have to include the following code in your Delphi form:

Uses  <...>,PdxAddIn, PdxForms;

If you don't include this code and have set your form to TParadoxForm, your Delphi form won't compile properly.

For information on PdxAddIn, see PdxAddin Unit. For information on PdxForms, see PdxForms Unit.


PdxAddin Unit

An instance of TParadoxAddin is created and managed for you when you include the PdxAddin unit in your project explicitly or implicitly. This instance is called "Paradox". To use the procedures and properties described below, use the following syntax, replacing ProcName with the name of the procedure you're calling:

Paradox.<ProcName>

The procedures in TParadoxAddIn fall under two categories:

•	procedures for registering menu items and forms with Corel Paradox

•	procedures that allow you to get information from Corel Paradox or to have some control over it

•	The procedures in each category are described in the table below.

Registering menu items	Communicating and controlling Corel Paradox

ClearForms	ResetStatusRegions

ClearMenus	SetStatusRegions

RegisterForm	SetStatusText

RegisterFormClass

RegisterMenu

Usually, you call the methods listed under the registering menu items category in your DLL’s initialization code.

In addition to the above procedures, the following properties can be accessed:

Property Name	Description

ParadoxInterface:IParadox;	Read Only. Reference to the IParadox interface that Corel Paradox provides to Addins. See Interface specifications provided by Corel Paradox for more information.

DesktopHandle:HWND;	Read Only. Window handle of the Paradox Desktop.

DesktopClientHandle:HWND;	Read Only. Window handle of the Corel Paradox Desktop MDI Client Window.

For information on the relationship between TParadoxAddin and the other components in the Corel Paradox Add-In Development Kit, see Overview of Delphi source files.


PdxDeskW Unit

Use of the Tf_ParadoxDesktop form is optional. However, it provides an easy, visual means to build additional menu items in the Corel Paradox Desktop menu system. For information about adding menu items using Tf_ParadoxDesktop, see Adding menus to the Corel Paradox Desktop.

For information on the relationship between Tf_ParadoxDesktop and the other components in the Corel Paradox Add-In Development Kit, see Overview of Delphi source files.


PdxForms Unit

TParadoxForm sets up much of the communication interface with Corel Paradox and your Delphi add-in. You have to inherit your forms from TParadoxForm to allow:

•	proper SDI child windows behavior (when specified), where the add-in form always stays in front of the desktop

•	proper MDI child window behavior (when specified)

•	all Delphi published properties to be accessible from ObjectPAL

•	registration of your add-in forms for ObjectPAL access

Descending from TParadoxForm should not adversely affect your form when used outside the Corel Paradox environment.

For information on the relationship between TParadoxForm and the other components in the Corel Paradox Add-In Development Kit, see Overview of Delphi source files.


dbClone Unit

TCursorTable is a Delphi TTable descendant and shares most of TTable's properties and methods. It takes a Borland Database Engine cursor handle instead of a table name. This allows you to clone and use cursors provided by Corel Paradox (through the ObjectPAL TCursor handle method) or Delphi (through the TDataSet handle property).

The TCursorTable component provides a Cursor property and two procedures (plus all methods provided by TDataSet) as described below.

Procedures

Sync

SyncTable

Sync and SyncTable update the position (and order) of the dataset to match the provided cursor/dataset. If the dataset is open, then the provided cursor/dataset must be compatible.

Property	Description

Cursor :HDBICur;	Set the Cursor property before calling OPEN (or setting the Active property to true).

For information on the relationship between TCursorTable and the other components in the Corel Paradox Add-In Development Kit, see Overview of Delphi source files. For more information on TDataSet and TTable, see your Delphi documentation.


About COM interface applications

Corel Paradox add-ins may be created by any language that is capable of generating COM-style or OLE-based interfaces such as C++ for example.

If you develop your Corel Paradox add-in using such a language, you also have to create the interfaces by which your add-in can communicate with Corel Paradox. The IParadox interface is provided when you install Corel Paradox. However, your add-in must provide its own interface to communicate with the IParadox interface. See Add-In interface specifications (COM) for information on the add-in interface that you will need to create. For information on the IParadox interface (supplied with Corel Paradox), see Interface specifications provided by Paradox.

If you use the Corel Paradox Add-In Development Kit for Delphi, the interface modules needed to communicate with Corel Paradox are supplied and ready-to-use.


Add-in interface specifications (COM)

You can create a Corel Paradox add-in using any language that supports the generation of COM-style interfaces. The specification of these interfaces can be found in iAddIn.pas.

For Delphi developers, we've already implemented those interfaces that are found in uAddIn.pas. In fact, Delphi developers can develop Corel Paradox add-in DLLs in a way similar to developing any other Delphi DLL.

To create a Corel Paradox add-in, you must provide an implementation of the IPdxAddin interface as specified in iAddIn.pas. To support menu items, you must also supply IPdxMenuList. To support forms, you must also supply IPdxFormList and an IAddinForm for each form. (All done for Delphi developers in uADDIN.pas).

In order for Corel Paradox to recognize your DLL as an add-in, you must export a routine called "ParadoxRegisterAddin" that accepts a single parameter of type IParadox and returns an IPdxAddin. These interfaces are specified in iAddin.pas, and the ParadoxRegisterAddin function is implemented (for Delphi) in PdxAddIn.pas.

For more information on the Interface concept, refer to your Windows documentation on OLE2 which also covers the Component Object Model (COM). The GUIDs for each interface are specified in iAddIn.pas.

The interfaces you need to implement are:

IPdxAddin = Class (IUnknown)

{ Paradox uses this as a central hook to get to all the other interfaces. No special methods - just use queryInterface. }

End;

IPdxInfoList = Class(IUnknown)

{ Base class definition for interfaces that give us a list of items/interfaces }

Procedure Clear; Virtual; StdCall; Abstract;

Function GetCount:Integer; Virtual; StdCall; Abstract;

Function GetName(Index:Integer):TBStr; Virtual; StdCall; Abstract;

Function IndexOf(Name:TBStr):Integer; Virtual; StdCall; Abstract;

end;

IPdxMenuList = Class(IPdxInfoList)

{ Paradox calls this to access each registered menu }

Procedure DoInit(Index:Integer); Virtual; StdCall; Abstract;

{ Paradox calls this to let you know the menu system is being (re)initialized }

Function InSubMenu(Index:Integer; Node:TPdxMenuNode):Boolean; Virtual; StdCall; Abstract;

{ Paradox calls this to find out if this index belongs to the NODE menu of Paradox }

Function GetHandle(Index:Integer):HMENU; Virtual; StdCall; Abstract;

{ Paradox calls this to get the Windows menu handle for an item }

Procedure DoClick(Command:Word); Virtual; StdCall; Abstract;

{ Paradox calls this to let you know the menu item was selected }

Procedure DoClickHelp(Command:Word); Virtual; StdCall; Abstract;

{ Paradox calls this to let you know that help for the menu item was selected }

end;

IPdxFormList = Class(IPdxInfoList)

{ Paradox calls this to get an IAddinForm for each registered form or form class}

Function Instance(Index:Integer):IUnknown; Virtual; StdCall; Abstract;

{ Instance will return an IAddinForm }

Function AttachWindow(wnd:HWND; title:TBSTR):IUnknown; Virtual; StdCall; Abstract;

{ Returns an IAddInForm for the specified window or window title, if match found }

end;

IPdxAutoList = Class(IPdxInfoList)

{ Reserved for future use - DO NOT IMPLEMENT }

Function Instance(Index:Integer):IUnknown; Virtual; StdCall; Abstract;

{ Instance will return an IDispatch }

end;

IAddInForm = Class(IUnknown)

{ Paradox calls this to manipulate an Add In Form }

Procedure bringToTop; Virtual; StdCall; Abstract;

Function close:BOOL; Virtual; StdCall; Abstract;

Function closeQuery:BOOL; Virtual; StdCall; Abstract;

Procedure getPosition(var x,y,w,h:longint); Virtual; StdCall; Abstract; {pixels}

Function getTitle:TBStr; Virtual; StdCall; Abstract;

Procedure hide; Virtual; StdCall; Abstract;

Function isMaximized:Bool; Virtual; StdCall; Abstract;

Function isMinimized:Bool; Virtual; StdCall; Abstract;

Function isVisible:Bool; Virtual; StdCall; Abstract;

Procedure maximize; Virtual; StdCall; Abstract;

Function menuAction(Command:Integer):BOOL; Virtual; StdCall; Abstract;

Procedure minimize; Virtual; StdCall; Abstract;

Procedure open; Virtual; StdCall; Abstract;

Procedure openAs(bDialog:Bool;bVisible:Bool); Virtual; StdCall; Abstract;

Procedure postMessage(Command:Cardinal; W:WPARAM; L:LPARAM); Virtual; StdCall; Abstract;

Function sendMessage(Command:Cardinal; W:WPARAM; L:LPARAM):LRESULT; Virtual; StdCall; Abstract;

Procedure setPosition(var x,y,w,h:longint); Virtual; StdCall; Abstract; {pixels}

Procedure setTitle(Title:TBStr); Virtual; StdCall; Abstract;

Procedure show; Virtual; StdCall; Abstract;

Function showModal:Integer; Virtual; StdCall; Abstract;

{ In place of Wait }

Function windowClientHandle:HWND; Virtual; StdCall; Abstract;

Function windowHandle:HWND; Virtual; StdCall; Abstract;

{ You can define whatever properties you want. The default Delphi implementation maps these to Delphi Published Properties. }

Function getProperty(Name:TBStr; Index:Variant):Variant; Virtual; StdCall; Abstract;

Procedure setProperty(Name:TBStr; Index, Value:Variant); Virtual; StdCall; Abstract;

Function getPropAsString(Name:TBStr):TBStr; Virtual; StdCall; Abstract;

Procedure setPropAsString(Name, Value:TBStr); Virtual; StdCall; Abstract;

Function getPropAsInteger(Name:TBStr):Integer; Virtual; StdCall; Abstract;

Procedure setPropAsInteger(Name:TBStr; Value:Integer); Virtual; StdCall; Abstract;

Function getPropAsFloat(Name:TBStr):Double; Virtual; StdCall; Abstract;

Procedure setPropAsFloat(Name:TBStr; Value:Double); Virtual; StdCall; Abstract;

end;

TPdxMenuNode is an enumerated type that specifies the location of a menu node:

TPdxMenuNode = ( pdxmFileNew, pdxmFileOpen,

   pdxmUtilities, pdxmNet{obsolete}, pdxmInfo,

   pdxmFile, pdxmProps{obsolete}, pdxmTools,

   pdxmHelp );


Add-In registration

Registering your form allows the Corel Paradox ObjectPAL AddinForm type to access it and communicate with it.

To add the code that registers your add-in form for Delphi

1.	In Delphi, open the project source file.

2.	At the bottom of your code, between the BEGIN and END statements, add the code specified for the appropriate situation, substituting your add-in form name for MyForm.

Multi-instance forms

For a form that can be loaded multiple times, with separate form windows for each instance, use the following code:

Paradox.RegisterFormClass( 'MyForm', TMyForm );

Single-instance forms

For a form that displays only one form window regardless of the number of times it is opened, use the following:

Paradox.RegisterForm( 'Form', TMyForm, MyForm );

Opening the form multiple times brings the existing copy to the front.

 Note

•	The PdxAddIn unit must be in your Uses clause. For more information, see PdxAddIn in the Uses clause. Also, your add-in form must be descended from TParadoxForm. For more information, see TParadoxForm.


Specifications for interfaces provided by Paradox
Interface specifications provided by Corel Paradox

Corel Paradox provides two interfaces (an automation interface and the IParadox interface) through which your application can communicate with Corel Paradox. The interfaces are passed into ParadoxRegisterAddin when the add-in is loaded. Delphi-based add-ins automatically save the pointer to this interface in the Corel Paradox object. C-based add-ins, however, will need to save the pointer themselves.

The interfaces that Corel Paradox provides you to use (passed into ParadoxRegisterAddin) are:

The Corel Paradox Automation Interface

IPdoxAutoPascal = Class ( IUnknown ) // The Paradox Automation Interface

public

// =================== Properties - status of the desktop

function getVisible:BOOL; virtual; stdcall; abstract;

function setVisible(newValue:BOOL):BOOL; virtual; stdcall; abstract;

// =================== Automation methods

// Desktop automation

function FormOpen(filename:TBSTR):longint;virtual; stdcall; abstract;

function ReportOpen(filename:TBSTR):longint;virtual; stdcall; abstract;

function ScriptOpen(filename:TBSTR):longint;virtual; stdcall; abstract;

function LibraryOpen(filename:TBSTR):longint;virtual; stdcall; abstract;

function TableOpen(filename:TBSTR):longint;virtual; stdcall; abstract;

function FormDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function ReportDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function ScriptDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function LibraryDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function FormNew:longint;virtual; stdcall; abstract;

function ReportNew:longint;virtual; stdcall; abstract;

function ScriptNew:longint;virtual; stdcall; abstract;

function LibraryNew:longint;virtual; stdcall; abstract;

function ReportPrint(filename:TBSTR):longint;virtual; stdcall; abstract;

function TableInfoStructure(filename:TBSTR):longint;virtual; stdcall; abstract;

function TableRestructure(filename:TBSTR):longint;virtual; stdcall; abstract;

function TableAdd(filename:TBSTR):longint;virtual; stdcall; abstract;

function TableEmpty(filename:TBSTR):longint;virtual; stdcall; abstract;

function TableSubtract(filename:TBSTR):longint;virtual; stdcall; abstract;

function Copy(filename:TBSTR):longint;virtual; stdcall; abstract;

function Rename(filename:TBSTR):longint;virtual; stdcall; abstract;

function Delete(filename:TBSTR):longint;virtual; stdcall; abstract;

function QueryOpen(filename:TBSTR):longint;virtual; stdcall; abstract;

function QueryDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function QueryNew:longint;virtual; stdcall; abstract;

function TableExport(filename:TBSTR):longint;virtual; stdcall; abstract;

function TableSort(filename:TBSTR):longint;virtual; stdcall; abstract;

function SQLQueryOpen(filename:TBSTR):longint;virtual; stdcall; abstract;

function SQLQueryDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function SQLQueryNew:longint;virtual; stdcall; abstract;

function DataModelDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function ScreenSheetDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function PrinterSheetDesign(filename:TBSTR):longint;virtual; stdcall; abstract;

function executeString(scriptStr:TBSTR; usesStr:TBSTR):TBSTR;virtual; stdcall; abstract;

function GetLastError:longint;virtual; stdcall; abstract;

function GetLastErrorAsString:TBSTR;virtual; stdcall; abstract;

procedure ShowLastErrorStack;virtual; stdcall; abstract;

function GetLastErrorStackDepth:longint;virtual; stdcall; abstract;

function GetLastErrorAtDepth(depth:longint):longint;virtual; stdcall; abstract;

function GetLastErrorAtDepthAsString(depth:longint):TBSTR;virtual; stdcall; abstract;

function MsgBox(strTitle:TBSTR; strMsg:TBSTR):longint;virtual; stdcall; abstract;

procedure Quit;virtual; stdcall; abstract;

{ Call this to shutdown Paradox }

end;

The IParadox interface

IParadox = Class ( IUnknown ) // Paradox provides this interface

public

{ Desktop }

Function GetDesktopHandle:HWND; Virtual; StdCall; Abstract;

Function GetDesktopClientHandle:HWND; Virtual; StdCall; Abstract;

{ Menu }

Procedure SetMenu( hwnd:HWND; menu:HMENU ); Virtual; StdCall; Abstract;

Procedure SetDeskMenu; Virtual; StdCall; Abstract;

Procedure RevertMenu;Virtual; StdCall; Abstract; // Use on close

Procedure RebuildMenu; Virtual; StdCall; Abstract;

Procedure SetStatusRegions(nRegions:Integer; RegionSizes:PInteger); Virtual; StdCall; Abstract;

Procedure SetStatusText(nRegion:Integer; RegionText:PChar); Virtual; StdCall; Abstract;

Procedure ShowHelp(HelpContext:Integer); Virtual; StdCall; Abstract;

Procedure DoMenuAction(Command:Word); Virtual; StdCall; Abstract;

Procedure RaiseError(ErrorId:Integer; ErrorText:PChar); Virtual; StdCall; Abstract;

// Delphi doesn't need (and shouldn't use) RaiseError.

// Paradox understands Delphi Exceptions, so use them instead.

// ONLY C/C++ should use, and only to return errors to PAL

// This routine doesn't return.

Function GetResourceHandle:Longint; Virtual; StdCall; Abstract;

// Paradox stores all it's resources in a central DLL.

// This routine provides the instance handle for that DLL so that

// you can access Paradox resources (via LoadString, etal).

Function GetAutomationInterface:IPdoxAutoPascal; Virtual; StdCall; Abstract;

// Paradox's Automation Interface (defined above)

// Use for opening tables, forms, etc.

end;


BDE, defined
BDE

Borland Database Engine (formerly IDAPI). Corel Paradox uses this database engine to access and deliver data. BDE maintains information about your PC environment in the BDE configuration file (usually called IDAPI32.CFG). Use the BDE Administrator to change the settings in this configuration file.


COM, defined
Component Object Model (COM)

An interface standard of communication between objects in the Windows environment.


dbClone, defined
dbClone

The Delphi unit name for the database component that provides support for working with BDE handles. Found in the source file dbClone.pas.


PdxAddIn, defined
PdxAddIn

The Delphi unit name for the Corel Paradox add-in component that provides communication routines and registration of menus and forms. Found in the source file named PdxAddIn.pas.


PdxDeskW, defined
PdxDeskW

The Delphi unit name for the virtual Corel Paradox Desktop. This form displays the menus available in Corel Paradox so that you can easily add custom menu options. The source file for the virtual Corel Paradox Desktop is PdxDeskW.pas.


PdxForms, defined
PdxForms

The Delphi unit name for the Corel Paradox form component that contains routines allowing a Delphi form to be used in Corel Paradox and maintain proper window relationship with the Corel Paradox Desktop. Found in the source file named PdxForms.pas.


ClearForms, defined
ClearForms

Procedure

Syntax

ClearForms;

Description

Clears the list of registered forms (and form classes).


ClearMenus, defined
ClearMenus

Procedure

Syntax

ClearMenus;

Description

Clears the list of registered menus.


RegisterForm, defined
RegisterForm

Procedure

Syntax

RegisterForm( aName:String; aFormClass: TParadoxFormClass; Var InstanceVariable{:PParadoxFormVar} );

Description

Registers a specific instance of a form. Corel Paradox will always get the same instance of the form. aName is the name ObjectPAL uses to access the form.


RegisterFormClass, defined
RegisterFormClass

Procedure

Syntax

RegisterFormClass( aName:String; aFormClass: TParadoxFormClass );

Description

Registers a form class. Corel Paradox will create new instances of the form as necessary. aName is the name ObjectPAL uses to access the form.


RegisterMenu, defined
RegisterMenu

Procedure

Syntax

RegisterMenu( aMenuNode:TPdxMenuNode; aMenu:TMenu );

Description

Registers a set of menu items to be placed added to the Corel Paradox menu system. These items must be contained in a Delphi menu object such as a TPopupMenu. aMenuNode specifies where the items should appear on the menu. The options for AMenuNode are:

Value	Description

pdxmFile	Menu item displays on the File menu.

pdxmFileNew	Menu item displays on the File, New menu.

pdxmFileOpen 	Menu item displays on the File, Open menu.

pdxmUtilities 	Menu item displays on the File, New menu.

pdxmTools	Menu item displays on the Tools menu.

pdxmHelp 	Menu item displays on the Help menu.

These options are defined in iAddin.pas. Refer to the iAddin.pas source file for more information.


ResetStatusRegions, defined
ResetStatusRegions

Procedure

Syntax

ResetStatusRegions;

Description

Resets the Corel Paradox message line to its default state.


SetStatusRegions, defined
SetStatusRegions

Procedure

Syntax

SetStatusRegions(Regions:Array of Integer);

Description

Sets the Corel Paradox status bar to have n+1 regions, where n is the number of elements in the passed array, and each element of the array is the approximate size of that region (in characters). The regions are numbered from 1 to n. Any space left over, goes into region 0, which is the default region. Most Corel Paradox forms set (or reset) the status regions on activation. So, to ensure that the regions are there when you need them, you have to place this code in your FormActivate event handler.


SetStatusText procedure
SetStatusText

Procedure

Syntax

SetStatusText(nRegion:Integer; RegionText:String);

Description

Sets the text of a region in the Corel Paradox status bar. Use 0 to set the text of the default region. Use 1-n to set the text of any other regions you set up.


Sync procedure
Sync

Procedure

Syntax

Sync( Cursor :HDBICur );

Description

Sync updates the position (and order) of the dataset to match the provided cursor. If the dataset is open, then the provided cursor must be compatible. If the dataset is closed, then the function clones the cursor and opens the dataset.


SyncTable procedure
SyncTable

Procedure

Syntax

SyncTable( DataSet :TDataSet );

Description

SyncTable updates the position and order of the dataset to match the provided dataset. If the dataset is open, then the provided dataset must be compatible. If the dataset is closed, then the function clones the dataset and opens the dataset.