Creating Complex Dialogs and Wizards with Dialog Builder
Dialog Builder allows developers to use Microsoft Visual C++ resources to build floating tools, dialog boxes, and wizards for use in Origin. All elements of a resource, including buttons, check boxes, radio buttons, sliders, edit boxes, combo boxes, list boxes, rich edit boxes, and worksheet and graph controls can be programmatically accessed and controlled using the Origin C programming language. Resource operations can be programmed entirely in Origin C.
This book contains a tutorial that uses Microsoft Visual C++, Origin, and the Origin C programming language to construct and launch a resource-only DLL containing a "Hello World" dialog. Additional sections describe in more detail how to create a resource only DLL using Microsoft Visual C++ and how to access your resources in Origin with Origin C. A number of complete Dialog Builder samples that come with Origin are also discussed. All samples discussed in this book can be found in this zip file.
Note: Beginning with Origin 2017, Origin C dialogs can be built using HTML and JavaScript. For most users, this will be a better approach than building tools using the older Origin Developer Kit. Building dialogs with the Developer Kit requires the user to create a resource DLL using Visual Studio. This has proven to be a barrier for many, both for development and for distribution. The HTML/JS approach eliminates such complications. |
Terms Used in this Book
Term |
Description |
Control |
A control is an object on a dialog, tabbed dialog, or wizard that gets or displays information, or that performs an action. Common controls include buttons, combo boxes, radio buttons, check boxes, list boxes, and text boxes. (See Microsoft Visual C++ Controls Supported by Dialog Builder for a list of the Visual C++ controls that Dialog Builder supports.) |
Dialog |
A dialog is a window that displays information or that contains controls to obtain information from the user. A dialog can be modal or modeless. When a modal dialog is open the user must close it before they can interact with Origin. A modeless dialog can remain open while the user interacts with Origin. A dialog can contain a placeholder for tabs or for wizard pages. The tabs or wizard pages are actually "sub-dialogs." If a dialog contains a placeholder for tabs or for wizard pages the dialog is referred to as the main dialog. The main dialog can also contain controls in a static area which would then logically apply to all the tabs or to all the wizard pages. |
Procedure File, Temporary Procedure File |
For dialogs and tabbed dialogs, the procedure file (.OPS) is created and written by Origin automatically. For wizards, the procedure file is created if the developer specifies that it be written by calling a Dialog class method. The procedure file provides a set of instructions that is read the next time you open the resource in Origin. These instructions include the types of controls on your resource, the default control settings, and recorded events (such as a button click) from a wizard. As you use your resource in Origin, modified settings and recorded events (such as a button click) are saved to a temporary procedure file (.TOP) which is continually written to, and read from, as you use the resource. After closing the resource, the temporary procedure file (.TOP) is automatically saved as the procedure file (.OPS) for dialogs and for tabbed dialogs, and can be saved as the procedure file (.OPS) for wizards. |
Page |
A page (or property page) is contained in a wizard sheet on a wizard and contains controls. Wizards may have two or more pages. |
Placeholder |
A Microsoft Visual C++ Picture control placed on a dialog used to position, size, and otherwise contain tabs on a tabbed dialog, pages on a wizard, toolbars, graph controls, worksheet controls, image controls, and custom controls. |
Property Page |
See Tab or Page. |
Property Sheet |
A placeholder for tabs on a tabbed dialog. |
Tab |
A tab (property page) is contained in a property sheet on a tabbed dialog and contains controls. Tabbed dialogs may have two or more tabs. |
Tabbed Dialog |
A tabbed dialog is made up of a main dialog, a property sheet, tabs, and controls. |
Tool |
A tool is a modeless dialog, often a tabbed dialog. |
Toolbar |
A toolbar is made up of a toolbar placeholder and buttons from bitmap files. Buttons perform an action when clicked by running an Origin C function. |
Wizard |
A wizard is made up of a main dialog, a wizard sheet, wizard pages, and controls. A wizard can also contain a wizard map. |
Wizard Map |
A wizard map helps you navigate through a wizard. The wizard map is displayed on the left side of the wizard. It shows you which wizard page is currently active, as well as which wizard pages have been activated. It also allows you to skip wizard pages in both the forward and backward direction. |
Wizard Sheet |
A placeholder for pages on a wizard. |
Note:It is also possible to open a resource in Origin created using a resource editor/compiler other than Microsoft Visual C++. See the section Creating and Accessing an Open Watcom Resource-only DLL for a description of how to build a Dialog Builder resource using the Open Watcom C/C++ software and access it in Origin with Origin C.
- Create a Hello World Dialog
-
Creating A Microsoft Visual C Plus Plus Resource-only DLL
- Getting Started Using the Origin Dialog AppWizard
- Choosing the Project Type for your Dialog
- Choosing the Programming Language to Control your Dialog
- Specifying the Dialog Caption, ID, and Name
- Specifying Tab (Page) Captions, IDs, and Names
- Editing the Microsoft Visual C++ Project Settings
- Opening your Resource and Workspace Files
- Adding Controls to your Dialog, Tabs, or Wizard Pages
- Renaming the Symbol Include header File
- Resizing Dialog, Tab, and Page Resources
- Microsoft Visual C++ Controls Supported by Dialog Builder
- Setting the Properties of Controls in your Resource
- Setting the TAB Order of Controls on a Dialog, Tab, or Page
- Saving and Building your Resource-only DLL
-
Additional Resource Topics
-
Accessing Dialog Builder Resources with Origin C
-
Creating and Accessing an Open Watcom Resource-only DLL
|