Editing Form Elements

Top  Previous  Next

 

The Edit Form Element dialog is shown when adding or editing elements from the Edit Form Definition function.  It's also used for adding or editing sub-elements for a Region element's Edit Form Element dialog, so you could potentially be multiple levels deep into the same dialog.

 

Here you edit all of the components of a Form Element.  This one dialog is used for all types of elements, even though different information is needed for each type.  To help avoid confusion, it will only show the fields that apply to the element type that's currently chosen.  Choosing a different Element Type will completely change most of the fields available on the dialog.

 

The common fields available to all elements are described first, followed by the type-specific fields for each element.

 

 

Element Type

 

Select the type of element you want to show.  There are four basic element groups:

 

Region -- Essentially a Form within a Form, a region contains other elements that are positioned within the region, relative to the region's position.  Thus an entire area of a Form can be moved by simply moving the region.  Any text elements within the region are also "clipped", so they can't go outside the region.  We recommend using regions for any logically similar "part" of a Form to make rearrangement easy.  Regions can also be used for the purpose of minimizing condition checks (the region's condition expression only has to be checked once for the whole region, rather than each element), or to help position things in columns (use a region for each column, and text within the region can be auto-wrapped and still stay within the column).

 

Text / Data -- Anything shown as text characters, either static text or text generated from a Data Expression.

 

Bitmap / Line / Box graphic elements -- Use a bitmap to include pictures or non-text elements of any kind on the Form.  Lines and boxes can also be drawn as needed.

 

Transaction table -- These are line regions but with specific content, which is basically a canned transaction table.  The table can be in several formats.  While the flexibility of the data shown in this element is somewhat limited, it's the only easy way of showing transactions on a receipt Form.

 

Note that Forms with a Format of "Character positions" cannot have regions or graphic elements, and are more limited in the transaction table formats available.

 

 

Top / Left

 

These specify the position of the element on the page (or within the region).  Each of these can be specified in one of 5 different ways, which you select from a list.  Most will also need a numeric parameter for the position/offset in inches, millimeters or characters depending on the Form's Format, or a percentage value.  If it's a character-position Form, character positions start at 1 (e.g. line 1, column 1).  For variable-position Forms, positions start at 0 inches or millimeters.

 

Absolute (in region) -- The numeric value indicates an absolute position on the page (or relative to the parent region's position).

 

Relative to prev. element -- The value indicates an offset from the position (top / left) of the element before it.

 

Percentage (of region) -- The numeric value indicates a percentage (e.g. 0 to 100) of the page or parent region's width / height.

 

Next avail. (+ offset) -- The numeric value indicates an offset from the "ending" position of the previous element.  See notes below.

 

Offset from right/bottom -- The numeric value indicates an offset from the bottom or right limits of the page or parent region.

 

These allow a lot of flexibility in positioning elements, often without having to know the exact size of a page.

 

Note that the offset values for "Relative" and "Next avail." positions can also be negative if desired (e.g. to partially overlap or show a superscript, for instance).

 

 

"Next avail." positioning

 

The "Next avail" positioning option is a very important one for text (but also useful for other elements).  

 

For Text and Data elements, the next available position is pretty straightforward (unless the Angle is non-zero as described below).   It's the next character or line position, whether the Form is character based or not.  For instance when used for a Top position in an element after a text element, it means the next normal line available or single-spaced text.  You don't have to worry about the size of the text or anything about where the previous text ended.  If you want a little gap, just include an offset of .05 for instance.  Or use -.05 to scrunch the text a little closer together.  Likewise, using if for the Left position will start at the next available character position.  Of course  you wouldn't normally use it for both the Top and the Left, just one or the other depending on whether you want the next text to be on the next line below or on the same line right after the previous text.

 

For other elements, there are some special considerations:

 

Transaction Tables -- The next available Left position is the right side of the table's area (not necessarily the last character printed), but the next available Top position is the actual next text line position.  This is because it's common to want the next text to start just below where the transactions ended, but there's no way to know how many lines will be in the table beforehand.

 

Lines and Boxes -- The next available top/left position will be the exact bottom/right of the line or box (mostly useful for positioning the next line or box to be drawn).

 

Bitmap images -- The next available top/left position will be the exact bottom/right of the image according to the element definition. However this is not necessarily the bottom/right of the image as drawn because of the special cases for zero height or width (see below).  In other words if you specify a 0 width, then the next left position will also assume that the bitmap was 0 width even though that really meant to keep the correct aspect ratio.  Also note that this may change in the future, so it's best not to use next available positioning after a bitmap at all unless you're specifying the exact size.

 

Regions -- At the "receiving" end, regions are considered a Form-within-a-Form so the "Next available" position coming into a region, that is for the first element inside the region, will always be zero (which of course is the starting position of the region, not the actual corner of the page).  However coming out of a region it remembers the "Next available" position of the last element inside the region.  Therefore the next element after the region will know where the actual printing inside the region left off.  Thus it's perfectly fine to make a region larger than you expect it might need, and then after the region you can pick up where the last text inside the region actually stopped.

 

Finally, don't forget the effects of the Condition -- as mentioned below, the "Next avail." position only counts the last element that's actually printed.

 

 

Condition

 

This Expression determines whether the element is included in the Form, and must return a True or False boolean value.  If used for a region, it affects all sub-elements in the region also (the entire region is skipped if the condition is False).  To edit the condition expression, click on the text box or click the Edit button next to it.  The Expression Creator dialog will be used to enter the expression.

 

Note that if the element is excluded due to the condition, then it's considered non-existent for purposes of positioning also.  That is, the "Relative" and "Next Avail." positioning mentioned above refers to the last element that's actually used, not necessarily the one just above it in the list.

 

 

Notes

 

These notes are for your reference, and will also appear in the list of elements.  We recommend putting notes in especially for Region elements so you can see what's included in the region, but it's a good idea for any element that's not obvious so you can tell what's going on if you need to edit the Form later.

 

 

Region Element Fields

 

Fields specific to Region elements:

 

Border

 

When this is checked, a simple black line will be drawn around the region.  Even if you don't plan on having borders in the final Form, this is very helpful in determining whether your region is positioned and sized properly while you're testing it.

 

 

Bottom / Right

 

Regions must have a bottom and right boundary.  As with the Top / Left position there are several ways to specify the bottom / right boundaries, with a few minor differences as described here:

 

Relative (height / width) -- The value indicates an offset from the Top / Left position of this element (so it's effectively a height or width value).

 

Absolute (in region) -- The numeric value indicates an absolute position on the page (or relative to the parent region's position).

 

Percentage (of region) -- The numeric value indicates a percentage (e.g. 0 to 100) of the page or parent region's width / height.

 

Percentage, relative -- The numeric value indicates a percentage of the space remaining on the page or parent region, starting from the top / left of the region.

 

Offset from right/bottom -- The numeric value indicates an offset from the bottom or right limits of the page or parent region.

 

 

Sub-elements in Region

 

All elements contained within the region are shown here, with typical editing functions.  This works the same way as the top-level Form Elements List, so refer to that section for details.

 

 

 

Text and Data Expression Element Fields

 

These fields are specific to text and data elements (with only a couple differences as mentioned below).  

 

If the Form uses Character-position format, most of the font and formatting options are not available -- only the alignment and auto-wrap options can be used.  Also note that for Forms using direct-to-port printing, the Text (or Expression result) may have "escaped" hexadecimal characters such as for auto-cutter or cash drawer control.  These must be in the form \xHH, for instance \x07 to send the BEL character.  Note the direction of the slash (backslash), and that the "x" is lower-case.  Also note that if any such escape sequences appear in center-aligned text, the alignment is based on the resulting single character, not the 4-character escape sequence.

 

 

Text (only in Text elements)

 

This is the static text to be displayed.  It can actually be any length -- click the Edit Text button to open a larger window to edit long text.  Note that the text can also include multiple lines, as long as the Auto-wrap option is also checked (of course this also results in auto-wrapping any lines too long for the region or page).  Multiple lines will be shown as-is in the large editing window, but the line breaks will be shown as " \\ " in the single-line edit box.

 

 

Expression (only in Data Expression elements)

 

This is an expression which will be executed and the results will be shown as text, subject to the Format below.  Once the expression is evaluated and formatted, all other aspects of the element work the same as a text element (e.g. the return value of the expression becomes the "static text" to be shown).  To edit the Expression, click on the expression text box or click the Edit Expression button.  The Expression Creator dialog will be used to edit the expression.

 

 

Format (only in Data Expression elements)

 

This determines the text formatting of numeric values, assuming the expression results in a number.  For non-numeric data, the "General" option should be chosen.  For numeric data, select an appropriate format, e.g. Currency, Integer, Percent, or Floating Point.  If none of these quite fits your needs, then you can select Custom Format and enter an expression to format the data any way you need to.

 

 

Custom Format Expression (only in Data Expression elements)

 

This field only appears when the Format selected above is "Custom Format".  To edit the format, click the Edit Custom Format.. button or simply click on the text box below it.  This invokes the Expression Creator dialog to edit the format expression.

 

The format expression should simply convert a numeric value to text.  The numeric value to be formatted will be available with the context function ThisValue, which will already be shown in the expression the first time you edit it.  There are several functions available for formatting numeric values.  For a simple example, lets say that we want to take the number an show it as a currency value rounded to the nearest dollar.  The expression entered would be:

 

 Currency( Round( ThisValue(), 0))

 

 

Color

 

This determines the color of the text and the background of the text.  An example is shown with the current colors selected.  Click the Text or Background button to change the combination as needed, and these will allow you to choose any color.  Of course black text and white background is the default, and the background is typically white (unless you want to use a lot of ink!).

 

 

Font

 

Any font that's installed in Windows can be used, in any size supported, with any combination of Bold, Italic, or Underlined attributes.  The most common font names are "Arial" and "Times new Roman", and occasionally "Courier New" for fixed-pitch text.  To change the font using the standard Windows font-selection dialog (which usually shows an example of the font), click the Select Font button.

 

Note that new elements will default to the most recent font selected, or the last font used in a Form element, so you don't have to constantly change the font for every element in the Form.

 

 

Shrink to fit available width

 

When this is selected, it can automatically re-size the text to keep it on a single line, within the borders of the page or parent region.  You also specify the smallest font size to which you'll allow it to shrink (anything smaller than 8 can be very hard to read).  If even the smallest size doesn't allow it to fit, then the text will be truncated (this can't be used with the auto-wrap option).

 

 

Align Text

 

Choose how to align the text on the page (or within the parent region), either Left, Right, or Center.  You can also choose to center the text vertically within the region.

 

 

Auto-wrap

 

When this is selected, text that's too long for one line will auto-wrap (without breaking words) to multiple lines as needed.  This is also required for supporting text with forced line breaks in it -- essentially any text that you don't want limited to a single line.

 

 

Angle

 

Using this is rather tricky, but it does allow support for drawing text at any angle.  Enter a number from 0 to 360 (0 is normal horizontal, 90 is "up", 180 is upside down, etc.).  Note that the text may or may not obey the bounds of any region, and the Auto-wrap, Alignment, and Shrink-to-fit options will be ignored.  Only single lines are supported.  Also, the "Next Avail" positioning of the next element may or may not have the results expected.

 

Basically it's fine for single-line text, but if you want multi-line text you'll need to manually figure out the absolute position for each line for the given angle, and how much will fit on each line.

 

 

 

Bitmap Element Fields

 

The following fields are specific to bitmaps:

 

File name

 

Enter the file name or use Browse to select it.  Note however that the file must reside in the same folder as the current database, and it's not backed up with the database (basically just like Map files).  Thus you may need to copy any files used to all computers using Campground Master.

 

The bitmap image file must be in a specific format for Campground Master to read it:  

 

 Windows Bitmap (.BMP) with RGB encoding, in either 16 or 256 colors

 

Note: The 16 above refers to colors, not "bits" -- a 16-bit format will not work.  In terms of "bits", it must be 4-bit or 8-bit format.

 

If the image is not in this format, an error will be shown when attempting to load the image.  Note that an RLE-encoded (run length encoded) bitmap cannot be used, it must be RGB encoded.  If your image is not in this format, use an image editing program to change the format, such as the Windows "Paint" program (see Start / Programs / Accessories for the Paint program).  When saving the file, use File / Save As and be sure to change the File Type to "256 color Windows BMP" (wording depends on the specific application, but look for "256" and "BMP" or "bitmap").  In some image programs, like Paint Shop Pro, you need to use the "Decrease # of colors" option to make it a 256-color image, and then save as a Windows BMP file.

 

 

Bottom / Right

 

Bitmaps must have a bottom and right boundary.  This indicates the area on the Form that the image will occupy, and if the original image is not exactly that size then it will be stretched to fit in this space (height and width are stretched separately, which can distort the image).

 

The same Bottom / Right options are available here as for Region elements, so refer to those above for details.  

 

However there are a couple special case for bitmaps -- if both a height and width of 0 is specified (e.g. using the Relative option), then the actual image height and width is used for that dimension.  This allows a 1:1 image sizing, however this will be in "pixels" -- so it may appear smaller than expected on the page.

 

Another option is to use one of the other options for one dimension and a Relative / 0 option for the other.  The image will be stretched to fit the non-zero height or width specified, and also stretched in the other dimension to keep the aspect ratio.  For an example, if you want the image to be in the upper left corner and exactly 4 inches wide, keeping the correct aspect ratio, then use the following settings:

 Top : Absolute / 0

 Left : Absolute / 0

 Bottom : Relative / 0  (which means keep the aspect ratio)

 Right : Absolute / 4.0  (make it 4 inches wide)

 

 

Line Element Fields

 

The following fields are specific to lines:

 

Bottom / Right

 

Lines must have a bottom and right position to specify the "end" of the line.  The line will be drawn straight from the top/left to the bottom/right, which can be any direction.  The same Bottom / Right options are available here as for Region elements, so refer to those above for details.  

 

Color

 

This determines the color of the line.  An example is shown with the current colors selected.  Click the Line button to change the color of the line.  Note that the (background) is not actually used in drawing the line, but if the line is to be white then you can select a black "background" just so the example shows up.

 

Line width

 

Enter a number for the width of the line.  Of course 1 is the skinniest.  The number is generally in printer-dots, so the actual width in physical size may depend on the printer used.

 

 

 

Box Element Fields

 

The following fields are specific to boxes:

 

Bottom / Right

 

Boxes must have a bottom and right position to specify the other corner of the box.  The same Bottom / Right options are available here as for Region elements, so refer to those above for details.  

Color

 

This determines the color of the outline of the box and the fill color.  An example is shown with the current colors selected.  Click the Outline button to change the color of the line around the box, and the Fill button to change the interior filled color of the box.

 

Line width

 

Enter a number for the width of the outline of the box.  

 

 

Transaction Table Element Fields

 

The following fields are specific to transaction table elements.  Note that for character-position format Forms, only the Bottom/Right and Table Type fields are available and the narrow paper format option is assumed.

 

Bottom / Right

 

Transaction tables must have a bottom and right position, similar to regions, which specifies the bounds of the table .  The same Bottom / Right options are available here as for Region elements, so refer to those above for details.  

 

Font / Shrink to fit

 

You can choose the font as well as the shrink-to-fit option just as for text elements above.  Note however that the shrink-to-fit option applies to each cell of the table individually, not the table as a whole.  Also, the font attributes for bold, italic and underlined cannot be chosen for table.

 

Table Type

 

There are four different types of tables available (only two of them can be used for character format Forms).

 

Standard receipt -- The basic receipt-type table used for most receipts, invoices, etc., where the charges and discounts are shown on the first section, then taxes, then any credits, and finally any payments.

 

Register-style statement -- In this format, the transactions are shown in their original order, with columns for Charges, Payments, and Balance after each transaction.

 

Credit card slip -- This is designed to just show the credit card payment -- it will only show the mos recent payment transaction on the slip with the total amount paid.

 

Purchase order -- This is for use only in Point of Sale purchase orders, where it uses purchase order transactions instead of customer transactions.

 

Narrow paper format

 

This flag is generally for 3" receipt printer output where the space is limited, but can also be used for E-mail forms if you don't want the table very wide.  Note that if you do not select this option with an E-mail form (or even if you do for that matter), make sure that you have the Fixed Pitch option selected for the Form.  It uses two lines for transactions, with the transaction description on one line and the quantity, each and total on a second line.  The total will be right-justified according to the number of columns (or boundary of the table element).

 

Grid lines

 

Select this option if you want grid lines for the table.  Don't forget that this can make receipts print much slower on ink jet printers.

 

Shade / color cells

 

Select this option if you want the Total column background shaded grey and the Total / Balance label in a black background.  Don't forget that this does take more ink.

 

 

Shrink to fit more lines

 

This option allows it to use an overall smaller font for the table as the number of lines increases, so more lines can fit on a page.  It's more efficient than printing multiple pages while allowing short receipts to have larger text, but it does make them less consistent.  When this is selected, you also specify the minimum font size to use.  It will shrink the font when needed to fit the rows within the table's area.

 

 

Max rows / page

 

You need to specify the maximum number of that can be printed rows per page.  If the number is too high, transactions may be cut off or overlap text at the bottom of the page.  Since some receipts may have a lot of "extra" stuff pushing down the transactions or appearing below it (like credit card info, "Additional sites", or multiple Receipt #'s), it's best to enter a lower number and let it print multiple pages even when there's some extra room.

 

Note that if the Shrink-to-fit option is enabled, assume that the smaller text size will be used by the time it reaches the maximum, and do some testing to see how many you can really fit with the maximum amount of "other" stuff printed (resulting in the smallest area available for the table).

 

 

Date / Qty / Each / Total widths

 

Enter the width desired for each of these columns.  You may enter 0 for the Date width to exclude that column, but the other columns will always be included.  You could enter 0 for their widths, but some remnants would still remain.

 

Note that for the Register-style statement, there is no Qty or Each column so this information is added to the Description, like "(6 @ $10.00)".  The Each width is used for both the Charges and Payments columns, and the Total width is used for the Balance column.

 

For E-mail forms and 3" receipts with Character positioning instead of Variable (inches/mm's), the widths specify # characters.  Also note that the element width as defined by the Left and Right parameters will be used as the total width of the table.  The recommended widths for E-mail would be 0 for Date, 6 for Qty, 10 for Each and 12 for Total.

 

Note that if the "Narrow paper format" option is selected for the table, these options will not be available as it uses a specific formatting.

 

You'll notice that there's no setting for the Description column -- the Description column will use any of the table's overall width left over after sizing the other columns.

 

 

 

Additional Topics:

 

Forms Overview

Forms Setup

Importing and Editing Sample Forms

Editing Forms

Form Elements List

Form Selection Dialog

 

Expressions

 

Advanced Customizations Overview & other topics

 

 


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

Campground Master Home