The text of a manual · part 7 of 10
TT Advantage Programmer's Guide, pages 61 to 70
Pages 61 to 70 of 92
The original document is the PDF (976 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the HHP TT3100 and Welch Allyn TT3100
Page 61
VB Mode
4
VB Mode
TT Advantage VB mode generates PC-resident applications that control TT3100 Series terminals. Programmers creating electronic transaction systems that consist of a Visual Basic application in a Windows operating system should use the VB mode, while programmers upgrading legacy systems should use the Script mode. VB mode applications are programs in which the entire application resides on the host. That is opposed to Script mode applications in which screen generation and data collection is handled by a script or program residing on the TT3100 Series terminal.
When to Use VB Mode TT Advantage VB mode is especially useful to developers who need to quickly develop interactive point of sale applications or prepare mock-ups and demos for project proposals. TT Advantage supplies the tools to quickly implement new applications for TT3100 Series terminals. TT Advantage extends the Visual Basic programming environment to include special forms, controls, and classes for creating TT3100 Series interactive point of sale applications. With TT Advantage, the need to generate machine or C code is eliminated. All of the low level details are taken care of by the TT Advantage Assistant.
Developing Applications in the VB Mode The visual programming environment of TT Advantage provides a high degree of parallelism between the host environment and interactive point of sale environment. Objects appearing on host forms are mirrored on interactive point of sale screens except those that should be hidden on screen. Both platforms operate simultaneously from the same program. Most program responses triggered by actions at the host closely match the program responses triggered by actions to the TT3100 Series terminal. Honing interactive point of sale applications proceeds quickly. As soon as the host runs the TT Advantage application, the form appearing on the host screen appears on the TT3100 Series terminal. The close coupling between host and TT3100 Series terminals enables rapid iteration of application designs. The responsive TT Advantage interface allows cause-and- effect between application changes and application performance to remain clear. Because developer hosts can run the VB mode application, it is possible to test many aspects of this application without having to hook a TT3100 Series terminal to the host. To test a VB mode application, set the project into test mode by setting the global variable, TEST_MODE, to “True.” TEST_MODE is found at the top of the ModMain module.
Communication The port number and baud rate can configure communication with a TT3100 Series terminal. The maximum number of ports to be used can be changed accordingly. If the port number specified is beyond the range, COM1 is selected as a default.
4-1
Page 62
SIGBOX.PORTS = 4 ' ^ ' CHANGE THIS TO DEFINE MAXIMUM NUMBER OF PORTS TO BE USED. ' SigBox.Port = 0 ' ^ ' change this to connect to necessary port ' "0" is for auto select ' SigBox.BaudRate = Baud9600 ' ^ ' change this to select required baud rate ' ' if necessary
V.A.start 'VA Required '---TT Advantage required code ABOVE
Distributing TT Advantage Applications After completing a TT Advantage VB mode application, create an exe program using the normal Visual Basic “Make Exe” process. To distribute applications to other machines, do one of the following: 1. Copy the “Distribution Setup folder” to the target machine. Run Setup.exe. This places all files normally required to run the program on the target machine. The executable file should now be able to run. -or2. Use an Install creation application (such as Visual Basic’s Application Setup Wizard, or InstallShield) to include all the necessary files in a Setup program for your executable file. Depending on the project, additional files can be required. The additional files that might be required are the following: mxVAhost.dll and VisualControls. ocx. Both files are found in the system directory.
4-2
Page 63
VB Mode Software Components Several software components are required for TT Advantage to function properly:
Class Name
Description
Additional Notes
VAevents.cls
This class allows code to be
Code for this component can be modified put behind certain VA events.
in certain areas. See the code in the class module for more information.
Controls Name
Description
Additional Notes
VisualControls.ocx
Provides the SigControl and
DO NOT MODIFY.
MSRArea controls
These function like normal OCX controls and must be listed in the controls windows.
Forms Name frmSplash.frm
Description
Additional Notes
Application specific splash
A modifiable graphical form for screen.
announcing an application or function or for displaying logos on the TT3100 Series terminal. Modify the splash screen for the form under development.
padStart.frm
MDIMain.frm
The first screen must always
To add more forms, see TT Advantage be padStart.
Forms on page 2-5.
This is the parent screen for all
DO NOT MODIFY.
the displayed forms.
Modules Name
Description modMain.bas modMain.bas module connects Add functions and subroutines to this file TT Advantage classes.
Additional Notes in the areas designated inside the code.
4-3
Page 64
References Name
Description
Additional Notes
Sigbox.ocx
Sigbox.ocx provides
DO NOT MODIFY.
connectivity between host and
Note: Sigbox.ocx is a control, but is used
TT3100 Series terminals.
as a reference.
Sigbox.ocx also supplies additional “non-standard” commands.
Normally the SigBox control is not needed for a TT Advantage project, but it needs to exist in the project as reference. SigBox is accessed indirectly through TT Advantage.
MxVAhost.dll
Controls the communication
DO NOT MODIFY.
with the TT3100 Series terminal
VB Mode Controls TT Advantage forms generate screen displays that run in a special environment - on TT3100 Series terminals. The special demands of the Hand Held Products interactive point of sale environment requires a different set of controls than the Windows environment native to Visual Basic. Thus, while many of the controls function in TT Advantage as they do in Visual Basic alone, some do not.
4-4
Page 65
Control Font Sizes Font characters displayed on TT3100 Series terminals come in six sizes. All characters in each font size have the same pixel dimensions. The TT Advantage font families are mapped onto the Courier New font families in the properties boxes of TT Advantage controls. The following table shows the correspondence between the TT Advantage font sizes and Courier New font sizes. TT3100 Series Terminal Font Sizes in Pixels
Courier New Font Sizes in Points
6x8
10 to 11 pt
8x8
12 pt
8 x 12
13 to 16 pt
12 x 16
17 to 22 pt
16 x 16
23 to 26 pt
16 x 24
27 to 30 pt
TT Advantage Tool Box Controls in the following diagram work in TT Advantage VB mode, some with modified capabilities. The MSRControl and SigControl are specialized controls supplied by TT Advantage. Controls that can be used in VB mode are shown and described below:
Label Command Button Check Box List Box
Timer Control
Shape
Line
Image SigControl MSR Control
4-5
Page 66
CheckBox The TT Advantage VB mode Check Box operates just as the Visual Basic Check Box. In VB mode, the check box can also be used in an option group by setting the tag property. Property
How property is used
Font-Size
Controls the size on the font on the pad. See Control Font Sizes, above.
Value
Sets the default value when displayed, depending on the status of the check box.
Caption
Controls the text displayed beside the check box.
Tag
Setting Tag to “hide” (lowercase) causes this control to be hidden. Setting Tag to “groupname” allows a check box to be used as part of an option group. When using multiple check boxes on the form, set the Tag property of each to the same value. Then, checking one box causes all others to uncheck. Groupname can be any string except the words “groupname” and “hide”.
USING THE CONTROL Touching the CheckBox image on the TT3100 Series terminal checks and un-checks the control. Use the normal Visual Basic control properties for determining the status of the check box (checkbox1.value). SEE ALSO Commands: V.A.PadFontSize, V.A.FontWidth, V.A.FontHeight
Command Button The TT Advantage command button functions the same way as the command button of the pure Visual Basic environment. Property
How property is used
Font-Size
Controls the size on the font on the pad. See Control Fonts section in this chapter.
Caption
Controls the text displayed inside the button.
Value
Sets the default value when displayed. Setting to True activates the click event of the command button.
Tag
Setting Tag to “hide” (lowercase) makes the control invisible.
Style
Setting Style to “0 - Standard” displays a normal button. Setting Style to “1 - Graphical” displays a transparent button.
USING THE CONTROL Use like a normal Visual Basic button. Put code under click_Event to execute commands when clicked.
Image Image controls display a black-and-white bitmap graphics on interactive point of sale screens.
4-6
Page 67
Images in VB mode stretch to fit the size of the image control. Images in VB mode can be in any VB compatible format (BMP, WMF, etc.). Static images in VB mode can be stored in the non-volatile TT3100 Series terminal so they appear faster and don't have to be transmitted to the interactive point of sale. To store an image, command TT Advantage to pre-load the form where the image resides. Use the Load “formname” in the “A_PreLoadForms” event of the Class module “VAEvents.” Note: For best image quality set the image control to the exact size of the imported image. Stretching the image can drastically alter the quality of the image displayed on the TT3100 Series terminal. Images should not be larger than 240 x 320 pixels and must not extend past the edges of the screen. Property
How property is used
Tag
Setting Tag to “hide” (lowercase) causes the control to be invisible.
BorderStyle
Setting BorderStyle to “0 - None” causes the Image control to display no border. Setting BorderStyle to “1 - Fixed Single” causes the Image control to display a border around the picture.
ToolTipText
Text entered into ToolTipText property box shows temporarily until the image displays - in Web fashion.
Stretch
The stretch property is not really used by TT Advantage. Setting the property to “'True” allows TT Advantage to display a sized image. Leaving the property “False” causes Visual Basic to resize it back to the original image size when the program runs. If Stretch is “False”, the size of the image cannot change.
USING THE CONTROL Use the TT Advantage image control like a normal Visual Basic image control. Set stretch property to “True” for correct functionality.
Label The Label control in VB mode functions like a normal label and includes the capability to word wrap. Property
How property is used
Tag
Setting Tag to “hide” (lowercase) makes this control invisible. Setting Tag to “clear” (lowercase) clears text from the label before it displays.
Font-Size
Font-Size sets the size on the font displayed on the form.
BorderStyle
Set BorderStyle to “0 - None” to make the label display with no border. Set BorderStyle to “1 - Fixed Single” to make the label display with a border.
USING THE CONTROL Use TT Advantage labels just like Visual Basic labels. SEE ALSO Commands: V.A.DisplayLabel
4-7
Page 68
Line The Line control works the same in TT Advantage VB mode as in the pure Visual Basic environment.
ListBox The ListBox control in TT Advantage VB mode works just like a ListBox control in pure Visual Basic. Use for displaying a list of selectable items that user can pick by touching the TT3100 Series screen. A ListBox on the TT3100 Series terminal adds a scroll bar and buttons when there are more lines in the ListBox than can be displayed all at once. Property
How property is used
Tag
Setting Tag to “hide” (lowercase) hides this control. Setting Tag to “scroll” places a scroll bar on the right side even if there is no need to scroll. Setting Tag to “groupname” allows use of the ListBox as an option group. If using multiple ListBoxes on a form, set the tag properties of each ListBox to the same value. Then selecting an item on one ListBox, de-selects the item on all the others.
Font-Size
Sets the size on the font on the pad.
ToolTipText
After the ListBox displays on the TT3100 Series terminal, the ToolTipText property displays the number of selections the ListBox holds. For example, if a ListBox draws on a screen and this property contains “7”, this means that the ListBox displays 7 lines at a time.
Enabled
Setting this property to True, allows the TT Advantage code to accept a click event.
USING THE CONTROL Use like a normal Visual Basic ListBox.
MSRControl Place the MSR Control anywhere on the form to activate the MSR. This control is visible on the host screen yet invisible on the interactive point of sale display. Once activated, the MSR captures data from card swipes. If a good swipe occurs, TT Advantage fires the GoNext Event for the form. The GoBack event fires where the MSR times out. Such an event occurs where the interactive point of sale didn't get a swipe within the time limit programmed for the swipe. In VB Mode, do not put code under the MSR GoodSwipe or BadSwipe events. TT Advantage ignores code in those events while in VB mode. Instead, put code under the GoNext event for the current form for good swipe. (Use timeout = 0 for no timout). EVENTS: •
GoNext - fires after a good swipe.
•
GoBack - fires after no swipe before timeout.
4-8
Page 69
Property
How property is used
Timeout
The number of seconds to wait before firing the GoBack event on the form. Property defaults to “0” for no timeout.
USING THE CONTROL When using the MSRControl to design screens, the control is visible on the host development screen but does not show on the interactive point of sale screen. After drawing this control on the form it will not appear on the device. To obtain data from the MSR, call the MSR.AssignTrackNames method, then use the MSR object to get the properties from the MSR. See MSR object in this chapter. Draw this control on the developer screen. SEE ALSO Commands:
SigControl The Signature Control displays signature data captured from the TT3100 Series terminal as a series of dots within the signature area. Use the Line control to draw a signature line in the signature area. Property BorderStyle
How property is used Setting BorderStyle to “0 - None” causes the SigControl to be drawn without a border. Setting BorderStyle to “1 - Fixed Single” causes a border to be drawn.
USING THE CONTROL Use this control to draw a signature area. To save the signature into a string variable, use the command: V.A.Signature. See VB Mode Commands on page 4-10. SEE ALSO Commands: V.A. Signature, V.A.Shrinkwrap
4-9
Page 70
Shape The Shape tool only displays rectangles on the TT3100 Series terminal. After placing a Shape on a form, a dialog box appears asking if the object should be a “Box (Filled)” or a “Frame (Transparent)”. For correct functionality the shape must be set to rectangle. Property
How property is used
BorderStyle
Setting BorderStyle to “0 - None” causes the rectangle to be drawn without a border. Setting BorderStyle to “1 - Fixed Single” causes the border to be drawn around the shape.
FillStyle
Setting FillStyle to “0 - Solid” fills the rectangular area with black. Setting FillStyle to “1-Transparent” draws a transparent rectangle.
FillColor
Setting FillColor to “0 -Solid” fills the rectangle with Black. Setting FillColor to non-zero fills the rectangle with White.
Note : If “FillStyle” is set to “1-Transparent,” FillColor property has no control to make the shape filled with black as described above.
TimerControl The TT Advantage VB mode Timer Control does not operates like Visual Basic timer control. The coding under the Timer1_Timer() event only executes after the given interval is reached after enabling the timer, and it executes only once. VA only recommends one timer control per form. Property
How property is used
Interval
Controls the delay for the action follows the timer
Enabled
Activates/deactivates timer
USING THE CONTROL TT Advantage VB mode timers do not act like Visual Basic timers. VB mode timers are ‘countdown’ timers. Enter the countdown time in the Interval box of the timer’s properties.
VB Mode Commands All TT Advantage commands require a command prefix. This prefix depends on the TT Advantage mode. For VB Mode, there are 3 command prefixes: “V.A.”, “MSR” and “SigBox”. Use TT Advantage Command prefixes to bring up Visual Basic's auto coding drop-down lists. They help complete commands and walk the developer through required parameters. This section describes all the TT Advantage commands that are available.
V.A. CurrentScreen ...................................................................................................... 66 DisplayPrevious Screen ....................................................................................... 67
4-10