Dialogs Setup

Top  Previous  Next


A "Dialog Definition" is a list of instructions for modifying a particular dialog.  Create a Dialog Definition for each system dialog that you want to modify, or for each new dialog you want to add.  


Note that only one Dialog Definition can be enabled for each system dialog, e.g. for the Edit Reservation dialog, but the definition can contain as many Dialog Elements as needed to make all of the customizations you want.


To create a Dialog Definition, go to Maintenance / Advanced Customizations / Dialogs.  This opens the Dialogs Setup dialog, which lists all current Dialog Definitions and has the typical functions for Adding, Editing, etc.  Since the order of the definitions doesn't affect any functionality, there is no Insert command -- but you can Move the dialogs up or down in the list if you want to rearrange them.


You can also Export one or more Dialog Definitions to a text file, or Import Dialog Definitions.  This is primarily for you to import Dialog Definitions created by the software provider, though it can also be used to transfer Dialog Definitions between multiple databases.


Dialog Definitions cannot have duplicate names. If you make a Copy of a Dialog Definition, text like "(copy 1)" will be added to the name to make sure it's unique.  Of course you can change this to be more appropriate.  Duplicate checking for the names is not case-sensitive ("My Dialog" is considered the same as "my dialog").



Importing Sample Dialogs


There are a few sample dialog modifications you can import, for example adding a button to Transactions dialogs for adding a 3% surcharge.  To use these samples, you must first Import them.  Click the Import dialog button, and you'll get a typical Windows file dialog labeled "Import Dialogs".  You need to locate the samples folder, which is typically C:\Program Files (x86)\Campground Master\Samples (most likely you just need to double-click the "Samples" folder to get there).  Now select the appropriate file, for instance "Sample Dialogs - Credit Card 3% surcharge button", and click Open.


When you're importing sample Dialogs, it may also import Macros or Scripts that are used in the definition.  If these are already defined, resulting in a duplicate name, then a warning will be shown listing the duplicates and what their names were changed to during the import.  These might be safe to delete, assuming the imported version does the same thing as the original version.  Otherwise you will need to change any expressions in the Dialogs that use the Macro or Script so that it uses the correct name.


The imported dialog(s) will be added to the list. Make sure you don't have multiple dialogs enabled for the same Base dialog (you will get an error when leaving Dialog Setup if that's the case).



Expression Functions for Dialogs


Most expressions in dialog element definitions need to do something with the controls in the dialog -- such as get and/or set a dialog control's current value, change which control has focus, modify controls or perform other functions within the dialog.  A whole set of functions are available for this, all of which start with the letters "Dlg".  Refer to the function types "User-defined dialogs" in the Expression Elements dialog (through the Insert Expression Element function of the Expression Creator) for all of the functions available for accessing and working with dialog controls.  


Note that there are separate sets of functions for new controls (added by the dialog definition) vs. standard controls (in an existing dialog), because new controls must be referenced by name whereas existing controls must be referenced by a numeric control ID.   Be sure to use the functions with "User" in the name to access a new control added in this dialog definition, and use the function without "User" in the name for standard controls that are in the existing dialog.



"Changed" Flag


Each dialog keeps track of a "changed" flag so that it knows whether anything needs to be saved back to the record when it's closed.  When you add a new control to a dialog, the program already handles this flag internally for obvious changes, e.g. when the value of the control is changed.  However there may be times that you need to change something internally and need to let the dialog know it.  There is an expression function DlgSetChangedFlag( ) for setting the "Changed" flag when needed.  There's also a function to get the current status of the flag, in case you want to see if something has changed before performing an action of your own.



Opening a Custom Dialog


Once you've created a new dialog, you need some way to open it.  Use the function DlgOpenUserDialog( ) with the dialog name to open the dialog.  You can also give it the record to be used (in context).  You might want to do this from a Menu definition, an Event, or from a button action in another dialog.


This function returns True if the "Save" or "OK" button is clicked (or more specifically if the DlgClickSave( ) function is called within the dialog expressions), or else it returns False if "Cancel" is clicked or if it's closed with the "X" button.




Additional Topics:


Dialogs Overview

Editing Dialogs

Dialog Elements List

Editing Dialog Elements


Dialog Control ID Reference




Advanced Customizations Overview & other topics



Page URL https://CampgroundMaster.com/help/dialogssetup.html

Campground Master Home