Xdialog Buttons

Description

Guides relating to Xdialog buttons.

Name
Description
Add Button Dialog

The Add Button dialog specifies the characteristics of a button used when setting Advanced Text Properties for a Conditional Expression.

Advanced Buttons

In using Xdialog it is sometimes necessary to format buttons. Often you will want to put bitmaps on buttons, combine bitmaps and text, and set the text on a button dynamically.

Anchor Buttons - Advanced Example

This script demonstrates several features of buttons. First, buttons can have "anchor" spots in them which allow you to break a single physical button into multiple "logical" buttons.

Checkboxes and RadioButtons - Columnar Layout

There is an option to lay out the choices in a checkbox or radiobutton group in multiple rows and columns. You can specify the 'snaking' style - left-to-right-then-top-to-bottom, or top-to-bottom-then-left-to-right.

Combining Text and Bitmaps on Buttons

It is often desirable to create a button with both text and a bitmap on the button. To mix text and an image on a button, you specify a special 'owner-draw' specification directive in the button's format specification.

Creating a Button that Calls an Action Script

Configure a button that uses an action script and the OnPush Event. This page contains a code explanation.

Creating a Button that Calls an Xbasic Script

How to configure a button that calls an Xbasic script using the onPush Event. Code explanaions included.

Creating a Button with a Bitmap

Button3 uses an Xbasic routine to copy the customer address to the clipboard. Button3 uses a bitmap instead of text to define its purpose.

Creating and Using a Multi-state Button

The MULSTBTN1 multi-state button presents a simple way to limit the Browse1 list to those records where the SearchBy field begins with the selected letter.

Creating Buttons that Run Code

How to create a button with an action script and attach a script to a button. This page also contains an explanation of the code involved in doing this.

Creating Buttons the Easy Way

The Alpha Anywhere Toolbar designer provides an easy way to create Xdialog buttons without having to remember any syntax. To use the "easy way out", create a new, blank, toolbar. Put a "Custom Button" on the toolbar. Select the button image and style (e.g. bitmap only, or text only, or text and bitmap). Specify the button text (if button style includes text) and the bubble-help.

Dynamic Buttons

The following example shows a dialog in which both the text and image on the button are dynamically derived. In this next example, the text and the image on the 'Save' button are changed when the user clicks on the button. The following script displays a dialog with a button with the text 'Save' on it:

Enabling the X Button to Close

The following example shows how to close a modeless Xdialog box when the user clicks its (close) button.

Menu Style Buttons

This example uses the button B directive, set to value "M", to cause the buttons to behave like menu entries.

Placing a Button on a Form

When you put a new button on a form, Alpha Anywhere assumes that you first want to attach a script to its OnPush event. Alpha Anywhere lets you define the action for the button in one of three ways:

Placing Buttons into Browses

You may place one or more buttons into any column of a browse. The button style may contain any combination of:

Putting a Button on the Dialog

Let's now make the "Hello World" dialog a little more complex by adding a button to the dialog.

Putting Bitmaps on Buttons

You can put bitmaps on buttons by specifying a format string for the button. The syntax for the format string command is:

Putting Table Navigation Buttons on Your Form

Button2 and Button3 provide convenient, on-form navigation controls for moving to the first and last records of the browse. The buttons have the following properties:

Radio Buttons

Creating and using radio button controls.

Setting Choices for Multi-State Buttons

A data field displayed as a multi-state button accepts only values that are in its choice list.

Setting the Button Hot Key

The button hot key allows you to click a button using a key combination on the keyboard instead of the mouse.

Setting the Button Width

In the above dialog, the OK button is not the same size as the Cancel button. You can set the size of a button by specifying optional character and line co-ordinates. The following script sets the buttons to 15 characters wide:

Variable Text on a Button

The text on a button can be derived from a variable. Where width is the width of the button in characters, height is the height of the button in lines, event_name is the name of the event ( a_dlg_button will be set to this value when the button is clicked) and ?condition is an optional logical condition that determines whether the button is enabled or disabled.

Web Style Buttons

This example shows how you can do "Web Style" buttons. Watch what happens when you move the mouse over a button. Each button has two owner draw strings. The string defined by O Directive is used when the button does not have focus. The OF Directive string is used when the button has focus. The O Directive does not have an underline attribute, while the OF Directive does have the underline attribute. Compare the two directives for a single button. This font specification is used when the button does not have focus: {F=Arial,8}.