Hi one and all
The Book "Building an Operator Interface with HP VEE" sounds to be
useful. Can anyone tell me where I can purchase a copy please.
Even though we are down in New Zealand we can usually obtain most items.
Thanks
Bruce
> ----------
> From: trgroleau@CCGATE.HAC.COM[SMTP:trgroleau@CCGATE.HAC.COM]
> Sent: Thursday, 23 April 1998 23:00
> To: hpvxd_xc@hpislsup.lvld.hp.com
> Subject: Re: VRF-PopUps
>
> Greg,
>
> You had a good response to the pop up question for a single
> point
> input used in multiple areas. You can include "OK" buttons, if
> you
> just want to get the input once for your program. An "OK"
> button or
> WAIT ON INPUT will not cause a User Object to become modal, which
> was
> sort of implied in your answer. In v4 the same applies to User
> Functions. The box will not become modal, so parallel threads
> will
> continue, but the calling thread will of course be stalled till
> the
> object completes.
>
> In your example, what happens if the user is in the process of
>
> typing in data when the function is polled? Does partial data
> come
> through, or does the "old" value still come through? Or does the
> call
> hang till the user is done typing? In these multi-threaded
> scenarios,
> sequencing can get to be a bear sometimes!
>
> As an aside to newer users: The concepts around building
> these
> kind of pop-ups are covered in "Building an Operator Interface
> with HP
> VEE" which is a really good book to read through. One of the
> most
> powerful concepts presented there is that a User Object does not
> have
> to satisfy all of its OUTPUT pins for the thread to continue.
> This is
> powerful when one realizes that a User Object or Function can
> ping
> different output pins depending on whether it completed
> successfully,
> as opposed to say 'C', where there is only one return value that
> must
> be tested by the caller each time the function is run. If you
> make
> the test internal to your User Function, you can eliminate a lot
> of
> redundant code and simplify the look of your program greatly.
>
>
> Thomas Groleau
> Tucson, Arizona
>
The Book "Building an Operator Interface with HP VEE" sounds to be
useful. Can anyone tell me where I can purchase a copy please.
Even though we are down in New Zealand we can usually obtain most items.
Thanks
Bruce
> ----------
> From: trgroleau@CCGATE.HAC.COM[SMTP:trgroleau@CCGATE.HAC.COM]
> Sent: Thursday, 23 April 1998 23:00
> To: hpvxd_xc@hpislsup.lvld.hp.com
> Subject: Re: VRF-PopUps
>
> Greg,
>
> You had a good response to the pop up question for a single
> point
> input used in multiple areas. You can include "OK" buttons, if
> you
> just want to get the input once for your program. An "OK"
> button or
> WAIT ON INPUT will not cause a User Object to become modal, which
> was
> sort of implied in your answer. In v4 the same applies to User
> Functions. The box will not become modal, so parallel threads
> will
> continue, but the calling thread will of course be stalled till
> the
> object completes.
>
> In your example, what happens if the user is in the process of
>
> typing in data when the function is polled? Does partial data
> come
> through, or does the "old" value still come through? Or does the
> call
> hang till the user is done typing? In these multi-threaded
> scenarios,
> sequencing can get to be a bear sometimes!
>
> As an aside to newer users: The concepts around building
> these
> kind of pop-ups are covered in "Building an Operator Interface
> with HP
> VEE" which is a really good book to read through. One of the
> most
> powerful concepts presented there is that a User Object does not
> have
> to satisfy all of its OUTPUT pins for the thread to continue.
> This is
> powerful when one realizes that a User Object or Function can
> ping
> different output pins depending on whether it completed
> successfully,
> as opposed to say 'C', where there is only one return value that
> must
> be tested by the caller each time the function is run. If you
> make
> the test internal to your User Function, you can eliminate a lot
> of
> redundant code and simplify the look of your program greatly.
>
>
> Thomas Groleau
> Tucson, Arizona
>
from: Greg Goebel / HP-MXD
gvg@lvld.hp.com / 800-452-4844
website: ftp://fcext3.external.hp.com/dist/mxd/index.html
to: VRf-Nuno Moreia
date: Thursday, 23 April 1998 0800 MDT
>From the VEE tutor on the Website:
[5.6] USING SHOWPANEL() & HIDEPANEL() / NONMODAL DIALOGS
* VEE 3.X introduced four functions to control the appearance and
disappearance of a UserFunction pop-up panel:
showPanel( UFname )
showPanel( UFname, x, y )
showPanel( UFname, x, y, width, height )
hidePanel( UFname )
(UserFunctions are described in detail in later chapters.) These functions
allow displays to be created "dynamically" instead of having to rely on a
fixed VEE user interface.
The game programs that are shipped with VEE 3.X illustrate some of the
interesting things that can be done with dynamic displays, but are rather
complicated to explain here. As a simpler example, consider the use of these
functions to build a "nonmodal" popup.
The Dialog boxes introduced in VEE 3.X have proven popular, but some people
are upset that they are strictly "modal" -- that is, when the program pops
one up, everything stops running until the user makes it go away or it times
out. Some people need to be able to display a pop-up while the program is
doing something (to tell the user to wait, for instance) and the standard
dialogs can't do that.
You can do this with "showPanel()" and "hidePanel()', however. To show how
this is done, I created a User Function named "PopUp" that consisted solely
of a Label object containing the text "Please Wait ... " in nice big black
letters, glued to the Panel View of the User Function. Then I wrote the
following program (check out xshopnl.vee for the source):
+----------------------+
| showPanel( "PopUp" ) |
+-----------+----------+ +---------------+
| | AlphaNumeric |
+-----------+----------+ +---------------+
| For Count [ 5 0 -1 ] +---->| |
+-----------+----------+ +-------+-------+
| |
+-----------+----------+ +-----+-----+
| hidePanel( "PopUp" ) | | Delay (1) |
+----------------------+ +-----------+
I put the Start button and the AlphaNumeric display on the Panel View; when I
hit Start, the popup came up and told me to "Please Wait ... " while the
count went down to 0, and then obediently vanished.
Note how you can provide optional parameters to "showPanel()" to specify the
placement (and size) of the pop-up; it comes up centered if they are not
specified.
* A few additional functions to support popups were added in VEE 3.2:
% lockPosition( <User_Function_name> );
This function locks a specified User Function in a specified place on the
display so a user cannot move it around with a mouse.
% unlockPosition( <User_Function_name> );
Allows users to move the panel again.
% panelPosition( <User_Function_name> );
Returns the X and Y pixel coordinates of the upper left corner of a panel
(disregarding title and border area), with the 0,0 reference location at
the upper left corner of the display.
% panelSize( <User_Function_name> );
Returns the width and height of the panel in pixels.
[%%]
[5.7] USING "SHOWPANEL()" & "HIDEPANEL()" FOR NONMODAL INPUT
* A customer had an additional requirement for a nonmodal dialog box that
could accept inputs; this was a somewhat more complicated requirement. To
get input from a nonmodal dialog, you have to do the following things:
% Create a UserFunction that only consists of input objects that do not wait
for input -- such as Constants, Enums, Toggles, and so on (OK buttons wait
for input so they're out, and none of the input objects should have Wait
for Input set). Put the input objects on the Panel View and have output
pins that provide their values.
% In the actual program, you can call this UserFunction any time you like to
see what the inputs are; it executes instantly and then returns the
values. Basically you are "strobing" or "polling" the UserFunction for
inputs. In between polls, you can do other things.
% The trick is, as long as you don't set "Show Panel On Execute" on the
UserFunction, you won't actually see it's panel ... until you do a
"showPanel()", and then it pops up, and remains up, whilst you strobe it
as often as you like. It's only active during a strobe, but you can still
see it.
% This implies that each time you strobe the UserFunction, you have to test
its return values; if the user presses a button to exit, you get that as a
return value, test it with an If/Then/Else, and then do a "hidePanel()".
If this is as clear as mud, consider an example: a VEE program that is
continually updating a clock, but allows you to pop up a dialog to input a
name; pressing OK on the dialog allows the name to be displayed, pressing
Cancel just continues with the program.
The guts of the UserFunction are idiot-simple (as noted above, they *have*
to be), consisting of a Text Constant and two Toggle (*not* OK) buttons:
+----------------------------------------------------------+
| UserFunction: PopUpTest |
+--+----------------------------------------------+--------+
| | | |
| | +--------------------+ | |
| | | What Is Your Name? | | |
| | +--------------------+ | |
| | | +----------->| Name |
| | +--------------------+ | |
| | | |
| | | |
| | +--------------+-------------------------->| OK |
| | | +--------+ | +--------+ | |
| | +->| OK +--+ +->| Cancel +--+ | |
| | +--------+ | +--------+ | | |
| | +--------------+------>| Cancel |
| | | |
+--+----------------------------------------------+--------+
Note how the Toggles are wired back to their Reset pins; this ensures that
they are reset after being toggled by the user. Also remember that you
should not set "Wait for Input" on the Text Constant.
I named the UserFunction "PopUpTest". I set up the Panel View like this:
+-------------------------------------------+
| |
| +--------------------+ |
| | What Is Your Name? | |
| +--------------------+ |
| | | |
| +--------------------+ |
| |
| +--------+ +--------+ |
| | OK | | Cancel | |
| +--------+ +--------+ |
| |
+-------------------------------------------+
The demo program itself is as follows (the source is in the file
xpoptest.vee):
+-------+
| Until | OK Button
| Break +--+ +-------+
+-------+ | +---------------+ | Quit +-----+
| | AlphaNumeric | +-------+ |
+---+---+ +---------------+ +---+---+
| now() +--->| 11:49:54 | | STOP |
+---+---+ +---------------+ +-------+
|
| +-----------------+
| Toggle | If/Then/Else |
+-----+-----+ +---+------+------+
+->| Run Test +--+-->| A | A==1 | Then +--+
| +-----+-----+ | +---+------+------+ |
| | | |
+--------|--------+ +------------+-----------+
| | showPanel("PopUpTest") |
| +------------------------+
|
| +-------------+
| | |
+-----------+----------+ | +--------+-------+
| Call Function | | | AlphaNumeric |
+-------------+--------+ | +----------------+
| | Name +------------------------|--->| Wile E. Coyote |
|[ PopUpTest ]| OK +-----+ | +----------------+
| | Cancel +--+ | |
+-------------+--------+ | | |
| | |
+------------------+ | |
| +------------------+ |
| | |
| | +------------------------------+ |
| | | If/Then/Else | |
| | +--------+-----------+---------+ | +-----+
| +-->| OK |[OK==1 ]| Then +--+-->| JCT +--+
+----->| Cancel |[Cancel==1]| Else If +----->| | |
| | Else | Else | +-----+ |
+--------+-----------+---------+ |
+------------+-----------+
| hidePanel("PopUpTest") |
+------------------------+
This program is in the form of a typical "parallel branch" VEE program, in
which one branch updates a clock (using "now()" and an AlphaNumeric set to
TimeStamp mode), the next allows you to display the UserFunction with
"showPanel()", the third tests the panel for inputs, and the fourth (in the
upper right corner) allows you to quit.
It is the third branch that is of real interest. It strobes the UserFunction
and returns the current state of its inputs; the "OK" and "Cancel" Toggles
are tested by an If/Then/Else object to see if either are 1 (meaning the user
has toggled them). If "OK" is set to 1, the "Then" output strobes the
AlphaNumeric to display the current "Name" string; if either are set, the
UserFunction is hidden with "hidePanel()".
Variations can be constructed on this theme as long as the basic rules are
followed: you just have to strobe the UserFunction on a regular basis and it
*cannot* contain any objects that might cause it to hang.
[<>]