Extending The Gupta Development Environment
Extending The Gupta Development Environment
Extending The Gupta Development Environment
Development
Environment
20-1230-1005
Trademarks
Gupta, the Gupta logo, Gupta Powered, the Gupta Powered logo, Centura, the
Centura logo, Centura net.db, Centura Web Developer, Fast Facts, Object
Nationalizer, Quest, QuickObjects, SQL/API, SQLBase, SQLBase Exchange,
SQLConsole, SQLGateway, SQLHost, SQLNetwork, SQLRouter, SQLTalk, and
Team Object Manager are trademarks of Gupta Technologies LLC and may be
registered in the United States of America and/or other countries. The trademarks
TeamWindows, ReportWindows and EditWindows, and the registered trademark
SQL Windows, are all exclusively used and licensed by Gupta Technologies LLC.
Adobe is a trademark of Adobe Systems, Incorporated.
IBM, OS/2, NetBIOS, and AIX are registered trademarks of International Business
Machines Corporation.
Java and Solaris are trademarks of Sun Microsystems, Incorporated.
Microsoft, Internet Explorer, Internet Information Server, DOS, Win 32, Windows,
Windows NT, Windows 95 and Visual Basic are either registered trademarks or
trademarks of Microsoft Corporation in the United States of America and/or other
countries.
Netscape FastTrack and Navigator are trademarks of Netscape Communications
Corporation.
Novell is a registered trademark, and NetWare is a trademark of Novell, Incorporated.
RoboHELP is a trademark of eWare Corporation.
All other product or service names mentioned herein are trademarks or registered
trademarks of their respective owners.
Copyright
Copyright 1996-2002 by Gupta Technologies LLC. All rights reserved.
Extending the Gupta Development Environment
20-1230-1005
May 2002
Extending the Gupta Development Environment
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Purpose of this Manual . . . . . . . . . . . . . . . . . . . . . . 6
Prerequisites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Typographical conventions . . . . . . . . . . . . . . . . . . . 6
Summary of Chapters. . . . . . . . . . . . . . . . . . . . . . . 7
Other Helpful Sources . . . . . . . . . . . . . . . . . . . . . . 7
Sending Comments to... . . . . . . . . . . . . . . . . . . . . . 8
3 Extending Objects
from SAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Setting object properties . . . . . . . . . . . . . . . . . . . . . . . . .2
Get and set properties . . . . . . . . . . . . . . . . . . . . . . .2
Writing code using the CDK . . . . . . . . . . . . . . . . . . .6
Populating a form using the CDK . . . . . . . . . . . . . .10
Index ........................................ 1
Preface
This preface explains how Extending the Gupta Development Environment can help
you use the Gupta Developer Extension Kit (CDK). In this preface, you find the
following information:
• Who should read this manual.
• Conventions used in this manual.
• How this manual is organized.
• Other helpful resources.
• How to send us your comments.
Prerequisites
This manual assumes you:
• Have installed your OS, Gupta, and the CDK.
• Are an experienced Gupta developer who is familiar with Gupta, object-
oriented programming, the SAL programming language.
• Are familiar with the concepts in the Using and Extending QuickObjects
manual.
Typographical conventions
We use these typographical conventions in this manual:
bold type Menu items, push buttons, and field names. Things that
you select. Keyboard keys that you press.
courier type Commands or code you must enter through the keyboard
exactly as shown.
Chapter 1
Getting Started
This chapter helps you start using the Gupta Developer Extensions Kit (CDK). It
describes:
• What the CDK is.
• The CDK Interfaces.
• What the CDK includes.
• System requirements.
quickly and easily create a window from a list of valid top-level windows in
your application.
CDK interfaces
The CDK has three interfaces:
• Outline interface
• Runtime Inspector interface
• Notification interface
Outline interface
This interface is a set of classes and functions you use to directly manipulate a
SQLWindows application outline from another program written in SAL or C++. To
use this Application Program Interface (API), you need to only understand the
structure of a SQLWindows application. The Outline interface is available as SAL
and C++ class libraries for SQLWindows and non-SQLWindows programmers.
Use this interface if you are a SQLWindows or C++ programmer and need to read
and generate SQLWindows applications using SAL or C++.
Notification interface
This interface allows a program to receive notifications when you change the outline
focus, delete an item, add an item, or open or save an outline in SQLWindows. You
can also create a tool that performs tasks, such as selecting a line in the Outline view,
expanding a node (on the left side) in the tree view, or changing (on the right side)
from the Layout tab to the Variables tab. These functions act on the user interface of
SQLWindows.
Component Description
CDK.APL A library that you can include in the SQLWindows outline. This
library gives your program access to the Outline interface.
You can find these files in the Gupta directory (base directory or the samples\cdksal
subdirectory).
Sample applications
The CDK provides several sample SAL applications (in the samples\cdksal directory)
to demonstrate various portions of the CDK framework. For more detailed
information, see the comments and code in the applications.
Notify.app Editor for any Demonstrates the Notification Interface. You can
outline run this application from the SQLWindows
toolbar.
Displays windows that monitor user edits (such
as, cutting and pasting text) to the currently open
outline.
VarEditE.app Editor for Shows how to add, edit, and delete global
VarEditS.app variables.
VisProp.app Editor for Shows many of the items you can modify for a
VisHost.app form. In addition, it creates visual objects on the
form.
We also provide sample source for building tools. You find these files in the
Gupta\tools subdirectory. They are:
• WizWiz.apt
• PropEdit.apt
• SoProps.apt
C++ CDK
You receive these components in the C++ CDK.
Component Description
Sample applications Applications used in the tutorials. See the following section for
details.
cdk.lib is installed in the Gupta directory. You can find include files in the inc
subdirectory under Gupta directory.
Sample applications
The C++ CDK provides sample applications (in the samples\cdkcpp subdirectory) to
demonstrate various portions of the C++ CDK framework. For more detailed
information, see the comments and code in the applications.
Open these applications in Microsoft Developer Suite.
Add-on tools
You receive these add-on tools for Gupta SQLWindows.
Tool Description
Item Explorer Displays the IT value stored for each item in the outline.
Wizard Wizard Turns your wizard application into a self-installing wizard so that
you can add new wizards to SQLWindows.
Property Editor Property Editor shows you properties for an object. You can
modify the properties.
Mass Customizer Mass Customizer enumerates all the child window objects of a
selected window, and you can change the attributes of one or
more of them at the same time.
Wizard Wizard
added to the
Wizards dialog
The newly installed wizard has been added to the list of available wizards.
Wizards store the information about themselves in the Microsoft Windows system
registry. You can view the contents of the registry by running the Registry Editor
application.
7. In Microsoft Windows, select Start, Run to display the Run dialog box.
8. Type regedit in the Open field and click OK. On NT, type regedit32.
Double-
click here
Chapter 2
Non-Visual Classes
_ErrorBase
cdkApplication cdkInterface
cdkStaticWindow
cdkClass
cdkConstant
cdkEnumeration
cdkEnumerationItem
cdkEvent
cdkEvents
cdkExtAbsBase cdkExtStructPointer
cdkExternalLibrary cdkExternalFunction
cdkFunction cdkInterfaceFunction
cdkLibrary
cdkMenu
cdkNotifyWindow cdkNotifyForm
cdkMenuItem
cdkMessageAction
cdkBuildSettings cdkResource
cdkVariable
cdkStaticWindow
Visual Classes
cdkWindow cdkVertical
ScrollBar
cdkLine
cdkRadioButton
cdkGroupBox
cdkFrame cdkPushButton
cdkBackgroundText cdkPicture
cdkOptionButton
cdkMultiLineText
cdkListComboBox cdkListBox
cdkHorizontal cdkComboBox
ScrollBar
cdkDataField
cdkCustomControl
cdkContainer cdkForm
cdkColumn cdkMDIForm
cdkDialog
cdkCheckBox
cdkBaseTable cdkTableWindow
cdkToolBar cdkChildTable
cdkDesignWindow
2. Define a visual class. Right-click Classes in the Tree view and select New,
Pushbutton Class from the displayed menu.
3. Enter cMyPB for the new class name and press Enter.
4. Right-click the Windows folder in the tree view and select New, Form Window
from the displayed menu.
5. Enter frmMain for the window name and press Enter.
6. If necessary, display the Controls toolbar (select Tools, Controls). Click the push
button tool.
Select cMyPB
from the class
7. Select cMyPB from the class list and drop a push button on the form.
8. Enter QuickObject for the push button label and press Enter.
9. Right-click the push button, select Properties, and then Object Name. Enter
pbQuickObject, press Enter, then click Done.
Now you link this push button to a property editor application using the
QuickObject Editor.
10. Select Component, QuickObject Editor to open the QuickObject Editor.
The new class, cMyPB, is highlighted in the Classes list box.
11. Click Browse to display the File Open dialog box. Select the path and directory
“samples” under the Gupta directory. Select ClasProp.app and click Open.
This step links the object (cMyPb in this case) to an external application. The
application filename can have the extension APT, APP, or EXE.
In this example, the ClasProp.app application is a QuickObject property editor
application and expects to be called with four parameters. This is discussed in the
next section. The QuickObject Editor automatically sets up the parameters.
12. Select dlgDemo in the Dialog Name list box.
13. Click OK to close the QuickObject Editor dialog box.
14. Right-click the QuickObject push button you dropped on the form, select
Properties, QuickObject to invoke the editor application with the property
dialog box (dlgDemo).
3. Click Add.
This clears the fields in the dialog box and adds a default value in the Command
field.
4. Replace the default value in the Command field with cbi*.exe.
This command line launches Gupta.
5. Enter -r ClasProp.app “dlgDemo” in the Parameters field.
6. Click the ... (Ellipsis) push button to display the list of additional parameters.
7. Click Current Outline.
8. Repeat Step 6 to add the MarkedItem and MainWindow parameters.
Your Parameters field now looks like this:
Toolbar
SQLWindows displays the Demo Properties dialog box (dlgDemo) from the
CLASPROP application.
4. Click Close in the dialog box and then close the second instance of SQLWindows.
You now have a tool on the toolbar that is linked to a property editor application. You
can click the tool and invoke the editor application from the source application at any
time.
Summary
Let us look at how this tool was set up:
• The tool icon launches Gupta SQLWindows because the command is the
SQLWindows executable filename.
• The -r parameter causes SQLWindows to run the ClasProp.app editor
application. This is useful for debugging the property editor.
• The “dlgDemo” parameter is the name of the dialog box that ClasProp.app
opens.
• The $Outline, $MarkedItem, and $MainWindow parameters are macros used
by ClasProp.app. These macros are pointers into the current environment so
that a second application (ClasProp.app in this case) can start working on it.
The Tools dialog box provides these seven macros:
Macros Description
Macros Description
Note: You can use any of the above macros as parameters in a typical QuickObject property
application but the first four parameters must be the property dialog box name, the current
outline, the marked item, and the filename of the editor application respectively.
2. Add CDK.APL (the CDK outline interface library) to the Libraries section. Click
the top level in the Application Explorer and then the Libraries tab. Right-click
Libraries in the Outline and select Add Next Level, File Include.
Select
File Include...
9. Enter GenerateCode for the push button label and press Enter.
10. Right-click the push button, select Properties, and then Object Name. Enter
pbGenerateCode and press Enter. Select Done.
11. Click the Variables tab.
12. Right-click Window Variables in the outline, select Add Next Level and then
variable cdkContainer. Enter aFormWindow and press Enter.
The code line looks like this.
Windows Variables
cdkContainer: aFormWindow
13. Right-click the line cdkContainer: aFormWindow in the Outline, select Add
Same Level, and then add variables cdkPushButton, cdkActionBlock,
cdkMessageAction, and Boolean as follows:
cdkPushButton: aPushButton
cdkActionBlock: aActionBlock
cdkMessageAction: aMsg
Boolean: bSuccess
Note: If the variable is not listed, click More to display additional variables in a
scroll list box.
The global variable representing the application is already defined by the
CDK.APL library. It is a cdkApplication object called CDK_App. When you read
in the outline for Source.app, you initialize this global variable to represent it.
3. Open Source2.app.
As you can see, a SAM_Create message has been added from a running Gupta
application.
2. Open the ClasProp.app application in the CDK SAL samples directory. The
default is c:\program files\gupta\samples.
.
Since Wizard Wizard adds code to launch the property dialog as a wizard in the
On SAM_AppStartup message, remove the message and dlgDemo.
3. Click the Actions tab.
4. Select the On SAM_AppStartup message and press Delete.
Select this
line and
press Delete
Double-click
here
Enter Property
Editor here
Click this
button
10. Click the ... (Ellipsis) button to display the Open Icon dialog box.
Double-click
14. Enter dlgDemo in the Dialog Box field and click Next.
Code added
to MyProp
The code added by Wizard Wizard has turned MyProp.app into a self-installing
wizard. The first time you run MyProp, it automatically creates the necessary key
and values in the Microsoft Windows Registry and displays an icon for
MyProp.app in the Wizards dialog.
2. Select Debug, Go to run MyProp.app.
3. Select Component, Wizards to display MyProp.app added to the Wizards dialog
box as a self-installing wizard.
Chapter 3
Extending Objects
from SAL
This chapter contains a number of procedures explaining how to extend objects from
SAL. The procedures:
• Get and set properties using QuickObjects.
• Use the CDK to set properties and write code.
• Use the CDK to populate a form with objects from an external application.
Since, in this tutorial, actions are specifically performed on a push button, the
cdkPushButton object is declared to manipulate the push button in the source
application.
• SetStrProperty takes the property name and value the user enters in the
property dialog box (dlgDemo) and sets the property and its value for the push
button pb1 in ClasHost.app. This value is stored internally in the outline.
3. Close ClasProp.app.
You commented out the On SAM_Click code because the editor application will
write this code into the source application.
3. Click pb1 in the tree view and then select Component, QuickObject Editor.
7. Enter MyProp in the Property Name data field and CDK is the key to
the future in the Property Val data field.
8. Click Write Code and then Close.
9. Click the Actions tab and open all the code below Message Actions.
As you can see, the property editor has written in new code and this code is
identical to the code written by the source application.
10. Select File, Save to save the changes.
11. Open ClasCode.app from the SAL CDK sample applications directory. The
default is c:\program files\gupta\samples.
12. Double-click Windows, dlgDemo, ChildWindows, and then click
pbGenerateCode and the Actions tab. Double-click On SAM_Click.
In this code, ClasObjc.app first initializes aForm to point to the selected form in
the source application. Then, it initializes the other variables to point to new
objects it creates.
3. Double-click dlgDemo, ChildWindows, and then click pbGenerateCode.
Double-click On SAM_Click to open the code below it.
As you can see in the code, several new functions have been added to
ClasCode.app:
• Call CDK_App.AddClass( "cQuickPushButton",
CDK_IT_PushButton, aClass )
Adds a new push button to frm1 (represented by aForm) and initializes the
window variable aPushButton to point to the newly created push button.
• Call aPushButton.SetObjectClass( "cQuickPushButton" )
Makes the push button visible in the Layout tab in the source application.
• Call aPushButton.AddMessageAction( "SAM_Click", aMsg )
Call aMsg.GetActions( aActionBlock )
Call aActionBlock.InsertAfter("Call
SalWindowGetProperty(hWndItem, df1, df2)")
Positions the background text object on frm1 and makes it visible in the
Layout tab in the source application.
• Call aForm.AddChildWindow( CDK_IT_DataField, "df1",
aDataField )
Positions the data field df1 on frm1 and makes it visible in the Layout tab in
the source application.
• Call aForm.AddChildWindow(CDK_IT_BackgroundText,
"Property Contents", BackgroundText)
Call aBackgroundText.SetWindowCoordinates( .588, 1.365,
1.6, .167 )
Call aBackgroundText.CreateWindow()
Call aForm.AddChildWindow( CDK_IT_DataField, "df2",
aDataField )
Call aDataField.SetWindowCoordinates( .588, 1.573, 2.2,
.25 )
Call aDataField.CreateWindow()
This dialog box creates a new tool with an executable name and an icon.
2. Click Add.
This clears the fields in the dialog box and adds a default value in the Command
field.
3. Replace the default value with clasobjc.exe in the Command field.
This command line launches Gupta and runs the editor application.
4. Enter "dlgDemo" in the Parameters field.
This tells ClasObjc.EXE to call dlgDemo and to initialize itself to point to the
outline currently open and the item currently selected.
5. Click the ... (Ellipsis) button and select Current Outline from the list.
6. Repeat Step 5 to add Marked Item to the Parameters field.
7. Enter path and directory where Gupta SQLWindows is installed.
The default is c:\Gupta.
The working directory is the path the editor application will use to search for any
files it depends on, such as dlls.
8. Enter Object Creator in the Menu Text and Tool Tip fields.
This text appears as the tool tip for the toolbar icon and as text in the Tools menu.
Your dialog box now looks like this.
9. Click OK.
You added a new tool to your toolbar. If the bar is not visible, select Tools,
Toolbars, check Tools, and click OK.
Now you are ready to use the Object Creator tool on a source application,
ClasHost.app.
4. Double-click Classes in the tree view, then highlight and delete the
cQuickPushButton class.
5. Click frm1 and select the Layout tab.
6. Click the Object Creator tool you added to the toolbar (the last icon) to display the
Demo Properties Dialog dialog box.
7. Enter MyProp in the Property Name data field and CDK is the tool of
the future in the Property Contents data field.
8. Click the Create Objects, Write SAL, and Set Property button.
The application creates the buttons and fields in the Demo CDK Host dialog box.
You created objects on an empty form by clicking a button on your toolbar! You
did this by invoking an editor application that wrote the code to create the objects.
9. Click Close in the Demo Properties Dialog dialog box.
10. Close the ClasHost.app application.
Chapter 4
Application types
You can create two types of applications using the C++ CDK: EXE and DLL. Both
types are discussed below.
EXE applications
EXE applications use CDLLI*.DLL (linked via CBDLL.LIB) to access outlines.
Note that due to the shared memory restrictions of Win 32, you cannot access an
outline currently loaded into SQLWindows. This means that EXE applications can
only operate on outlines loaded from a file.
DLL applications
DLL applications operate in conjunction with a running instance of Gupta
SQLWindows (CBI*.EXE). These applications can operate on an outline loaded
from file or the currently loaded outline. You can invoke the DLL in these ways:
• External tools: Attach the DLL to the Tools menu or add it to a toolbar. Read
Chapter 5, Extending Objects from Microsoft Visual C++, for details.
• QuickObject editor: Attach the DLL to a class in an outline. You can do this
by adding a special entry to the Registry Editor, which adds a new option to
the Customizer. Read Chapter 5, Extending Objects from Microsoft Visual
C++, for details.
• User wizard: Attach the DLL as a wizard. You can do this by adding entries
to the Registry Editor in Microsoft Windows.
Installation directories
When you set up your compiler environment, the compiler and linker must be able to
locate the header files (Gupta\inc directory) and .LIB files (Gupta directory) required
for building projects.
Note: If you did not install Gupta Team Developer in c:\Gupta, use the appropriate path and
directory name in Steps 4 and 5.
c:\Gupta\inc
5. Add the following lines to your library file directories:
c:\Gupta
6. Click OK.
Note: This key does not exist in the default installation; you must add it manually.
There can be more than one entry under this registry key, but it is important that the
string name for each entry be unique. Use the format shown below to make registry
entries:l
where testlib.dll is replaced by a dll name of your choice. This dll must have an entry
point of SWinDesignHookSet. This entry point is called after the outline window is
created. It takes no parameters.
SwinDesignHookSet should call SalOutlineSetOutlineHook. This function takes one
parameter, which is the address of the function you want to be notified of certain
events. The SalOutlineSetOutlineHook returns the address of the previous hook
function (or null). It there is a previous hook, it should be called from the new hook
function, or the chain will be broken and unknown results will occur as the events
will not get propagated across the chain. The hook can also be set from a quickobject
dll or from a SQLWindows specific custom control.
The following functions in the CDK deal with design hooks.
BOOL CDKClearDesignHook(LPCSTR lpszDLLName)
Clears the design hook DLL passed in as a parameter from the registry.
Parameters
Setting design hooks into the SQLWindows IDE
Chapter 5
Note: You cannot use .EXE files written using the C++ CDK as property editors because of
shared memory constraints of the Win 32 API.
Labels
Text
Standard
Standard Close button
2. To display the properties and labels for any of the objects, right-click the object
and select Properties.
In this dialog box:
• The ID for the dialog box is IDD_PROPDLG.
• The ID for the edit field below Property Name is IDC_PROPNAME and the
ID for the edit field below Property Value is IDC_PROPVALUE.
• The ID for the Apply button is IDC_APPLY and the ID for the Close button
to IDC_CLOSE.
In this dialog:
• The class name for the new class (based on the property dialog) is
CPropEditor.
• The class contains the objects listed in the Object IDs list box.
• The Apply and Close member functions have the message BN_Clicked
associated with them. These will be discussed later in this chapter.
Now, let us look at the member variables for the controls.
2. Click the Member Variables tab.
In this code:
• The #include "cdk.h" statement gives access to the CDK classes and
their functions.
• CGWindow* pWindow = NULL is a pointer to the CGWindow class object,
which represents the window object (push button, form, or data field) selected
when you launch the property editor.
• The pWindow variable is used by the CPropEditor constructor in
PropEdit.cpp to initialize member variable CDK_Window. (Note that this
corresponds to the CDK_Window SAL object in Chapter 3.)
In this code:
• The code below void CPropEditor::OnApply() is the implementation for
the OnApply function.
• The SetProperty function takes the property name and value the user enters in
the Property Name and Property Value fields and saves them as the member
variables m_sPropName and m_sPropValue.
In this code:
• The include statement #include "qointf.h" gives access to the
QuickObject interface classes and functions.
• The function DoQuickObjectEditor has been overridden by adding this code:
//Construct a property editor
CPropEditor PropEditor(CWnd::FromHandle(hWndParent),
&Container);
return PropEditor.DoModal();
1. Double-click Clasprop.cpp.
Note: If you have trouble locating header files or are getting linker errors, check your library
include path. The CDK.H file automatically links to the CDK LIB file. See Chapter 4, Using the
CDK from Microsoft Visual C++, for details.
In this window:
• The editor application uses strings to mark generated code in the
SQLWindows source application.
• IDS_BEGINBLOCK identifies the string that is entered at the beginning of
the block of code and IDS_ENDBLOCK identifies the string that is entered
at the end of the block of code. Marking generated code in this manner
prevents the application from overwriting or removing user-added code.
In this code:
• The aMsg and aActionBlock objects represent code to the Message Actions
section of CDK_Window, the QuickObject. The object aMsg represents a
SAM_Click message to the Message Actions of CDK_Window and the
object aActionBlock represents the code below On SAM_Click.
• The CDK_Window QuickObject calls the AddMessageAction function to
initialize the aMsg object. By passing SAM_CLICK and aMsg as parameters,
the function creates a new On SAM_Click message in CDK_Window and
aMsg points to the message.
• The Actions object is initialized by calling the GetActions function for aMsg.
Since adding a cdkMessage object with AddMessageAction creates a
complete action block, aActionBlock simply points to the this action block.
This is why the code uses a function that gets rather than a function that adds.
• The RemoveBlock function looks for code in the Message Actions section of
the SQLWindows application (ClasHost.app) that begins and ends with the
strings (defined in the previous procedure) and then removes the code.
• The AddBlockMarkers adds comment strings (defined in the previous
procedure) to the Actions section of CDK_Window. Code is added between
the strings by the InsertAfter function, described next.
• The InsertAfter function sets the properties for CDK_Window. The
SalWindowGetProperty function call is added to On SAM_click for
CDK_Window. At runtime, this call enables CDK_Window to retrieve the
properties set and stored at designtime in the outline using SetProperty
function call in PropEdit.cpp.
3. Close the workspace.
In this code:
• A new variable CGContainer has been declared and set equal to aWindow.
The variable aWindow points to the selected object and in this tutorial, the
selected object is the top-level window.
• The variable aWindow gets passed to DoQuickObjectEditor function as a
CGContainer.
In this code:
• CGApplication CDK_App;
CGChildWindow aPushButton;
CGChildWindow aDataField;
CGChildWindow aBackgroundText;
CGMessageAction aMsg;
CGActionBlock aActionBlock;
CGItem BeginMarker;
Creates the window with the Get Property push button with the coordinates
and the title.
• The remaining code adds the text fields, push buttons, and labels. Read
Chapter 3, Extending Objects from SAL, for details.
In this code:
• A special entry point, called GuptaTool has been declared. SQLWindows
looks for this function when a toolbar utility has DLL as its extension. Note
that GuptaTool must also be added to the DEF file.
• The variable hWndParent is set to the window handle of the Gupta Frame.
• The Container is initialized with the first marked or selected item in the
outline. Even though the user can select more than one item, this code
operates only on the first item selected. If the selected item is not allowed by
the container class, GetFirstMarked will fail.
2. Double-click ClasProp.def under ClasProp files.
As you can see in this code, GuptaTool is added to the EXPORTS section of the
DEF file.
Click here to
add a new tool
This creates a new tool with a default executable name and an icon automatically
pre-selected. You can choose a different icon from the list at the bottom of this
dialog if you wish.
3. Click Add.
This clears the fields in the dialog box and adds a default value in the Command
field.
4. Replace the default value with clasobjc.dll in the Command field. Browse
to this file. The default location is Gupta\samples\cdkcpp\tut3\release.
This command line runs the dll application.
5. In the working directory, enter path and directory where Gupta SQLWindows is
installed. The default is c:\Gupta.
The working directory is the path the editor application will use to search for any
files it depends on, such as dlls.
6. Enter Object Creator in the Menu Text and Tool Tip fields.
This is the text that will appear in the tool tip for the toolbar icon and in the Tools
menu.
7. Click OK.
You have now added a new tool to your toolbar. If your toolbar is not visible,
select Tools, Toolbars from the menu and check Tools in the list box and click
OK. Any tools you add will appear on the toolbar.
Now you are ready to use the Object Creator tool on a source application.
9. Select all the objects on the form and delete them. Your form looks like this:
10. Double-click Classes in the tree view, then highlight and delete the
cQuickPushButton class.
11. Click frm1 and select the Layout tab.
12. Click the Object Creator tool you added to the toolbar (the last icon) to display the
Demo Properties Dialog box.
13. Enter MyProp in the Property Name data field and CDK is the tool of
the future in the Property Contents text field.
14. Click the Create Objects, Write SAL, and Set Property button.
The application creates the buttons and fields in the Demo CDK Host dialog box.
You created objects on an empty form by clicking a button on your toolbar! You
did this by invoking an editor application that wrote the code to create the objects.
15. Click Close in the Demo Properties Dialog box.
16. Close the ClasHost.app application.
Index
O U
object properties, setting 3-2 UnitTest.app 1-5
objects, create 3-9, 3-10
OnApply function 5-12 V
outline interface 1-3 VarEditE.app 1-6
VarEditS.app 1-6
P VisHost.app 1-6
PreProc.app 1-4 VisProp.app 1-6
Prerequisites visual CDK classes 2-3
for using Quest 1-6
PromptE.app 1-6 W
PromptS.app 1-6 Wizard Wizard, add-on tool 1-8
PropEdit.cpp 5-13, 5-16 wizards
PropEdit.h, header file 5-6 DLL applications 4-2
property editor, basics 3-2 install application as wizard 2-18
pWindow variable 5-7 installing Wizard Wizard 1-8
writing code, using CDK 3-6
Q
qointf.cpp 5-15
QOINTF.CPP file 5-3
QOINTF.H file 5-3
QuickObject editor
modifying in C++ CDK 5-12
using in SAL CDK 2-4
QuickObject editor, creating in C++ 5-2
QuickObject editor, DLL applications 4-2
R
RegisterQuickObjectInterface function 5-11
RemoveBlock function 5-14
runtime editor application, writing code 2-12
runtime inspector interface 1-3
S
SAM_Click message, commenting 5-12
samples, C++ CDK 1-7
samples, SAL CDK 1-4
SetStrProperty function 3-5, 3-9
shared memory constraints, Win 32 API 5-2
Source.app 2-8
string table, adding strings 5-12
SWinPropGetCallbacks function 5-10
T
tool bar tools, setting up 2-11