Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > GUI Development
  New Posts New Posts RSS Feed - GUI popups from greenscreen
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedGUI popups from greenscreen

 Post Reply Post Reply
Author
Message
dynamic View Drop Down
Senior Member
Senior Member


Joined: June 28 2007
Status: Offline
Points: 188
Post Options Post Options   Thanks (0) Thanks(0)   Quote dynamic Quote  Post ReplyReply Direct Link To This Post Topic: GUI popups from greenscreen
    Posted: July 06 2007 at 8:26am
I feel like such a newb.

We would like to slowly GUIize our application. First was to get a way to print to laser and jet printers. That was solved immediately with AccuTerm. Second was to create PDF's and email and fax documents. That was solved with PrintWizard. (Thanks to Pete for these solutions.)

Next would be calling a GUI lookup popup from a text screen. For example the user is at a line looking for a department. If the user entered a ? a Windows style popup displaying the departments and names would show. It would remain open until the user clicked on a department or hit a cancel button or hit ESC. Would that be a grid? Do I have to start by creating a new GUI application or does this get in my current greenscreen application (account)?

Is there a good place to see how this is done?

Thanks for any help out there.

Andy Wilson
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: July 06 2007 at 9:48am
Hi Andy -

You have two choices for creating a GUI popup window. The quick and dirty way is to use the sample ATLISTBOX subroutine. This is a dialog box with a single-column list box, OK and Cancel button. To display multi-column data, you can use a fixed-pitch font and spaces to align columns. This subroutine uses the dialog function of the scripting engine.

A more elegant approach is to create a real GUI dialog. Use the GUI designer to create a dialog form, add a list box, enter column headings, OK & Cancel buttons, then use the code generator to create the base program code using the Dialog code tempalte. Add your own arguments to the subroutine to pass the list contents in and the selection out. The points where you need to initialize and return data are pretty easy to spot. Add event handlers for your Cancel & OK buttons, and maybe a double-click event for the list (just GOSUB to the OK handler). This approach gives you much more flexibility.

Thanks,

Pete
Back to Top
LiveBlues View Drop Down
Groupie
Groupie


Joined: February 28 2005
Status: Offline
Points: 93
Post Options Post Options   Thanks (0) Thanks(0)   Quote LiveBlues Quote  Post ReplyReply Direct Link To This Post Posted: July 07 2007 at 4:00pm
Andy,

I would definitely go with Pete's second solution. It is a simple enough project that will get you a little exposure to the GUI editor, and then working on the skeleton app to make it work for you.

Pete,

I have done an app that I run from a menu in a green screen environment, but I haven't done anything that would be ran from within a green screen program. Would you just use an EXECUTE statement within the green screen app to run the GUI app?
Back to Top
dynamic View Drop Down
Senior Member
Senior Member


Joined: June 28 2007
Status: Offline
Points: 188
Post Options Post Options   Thanks (0) Thanks(0)   Quote dynamic Quote  Post ReplyReply Direct Link To This Post Posted: July 09 2007 at 3:37am
Thanks, I'm trying the dialog, but not getting very far. I have a dialog form called Lookup. It contains a Listbox called List1 and 2 Command buttons for OK and Cancel. I am trying to populate the Listbox from the forms code to see if I am on the right track, but I guess I'm not since it's not doing anything. I've only added a little bit of code in the GUI STARTUP block:

*-->BEGIN GUI STARTUP<--*
ACCEPT = 0 ;* Assume dialog cancelled (update in your OK button Click handler)
* Add your code to load initial values here...
LIST=''
LIST<1,1,1>="1"; LIST<1,1,2>="STORE 1"
LIST<1,2,1>="2"; LIST<1,2,2>="STORE 2"
CALL ATGUISETPROP(GUIAPP,GUIFRM,'LIST1',GPITEMS,0,0,LIST,GUIERRORS,GUISTATE)
CALL ATGUISHOW('GUIAPP','LOOKUP','','',GUIERRORS,GUISTATE)
IF GUIERRORS<1> >= 2 THEN RETURN
*-->END GUI STARTUP<--*

It compiles okay, but the form preview does not fill the listbox. Any help to get me on my way would be appreciated.

Andy
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: July 09 2007 at 3:38am
Hi LiveBlues -

No problem using EXECUTE to run a GUI app from a green screen app, but make sure that the green screen app itself was not launched via EXECUTE from another GUI app.

Thanks,

Pete
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: July 09 2007 at 3:50am
Hi Andy -

You're on the right track. The problem with your call to ATGUISETPROP is that the GUIAPP and GUIFRM variables are not yet valid - these are assigned in the event loop, which runs after the startup section. Look at the next line, at the call to ATGUISHOW. Notice that the first two arguments (app & form) are quoted strings. You can use the same quoted strings in your call to ATGUISETPROP and all should be well. Also, you should check for errors after every call - you would have received an "invalid ID" error, and maybe that would have helped you identify the source of the problem more quickly.

Thanks,

Pete
Back to Top
dynamic View Drop Down
Senior Member
Senior Member


Joined: June 28 2007
Status: Offline
Points: 188
Post Options Post Options   Thanks (0) Thanks(0)   Quote dynamic Quote  Post ReplyReply Direct Link To This Post Posted: July 09 2007 at 5:39am
That brings up two questions. First, would it be better to change the listbox properties in the form activate event? And second, how do I display the error, or should I return it to my calling program.

Oops. Changing my first two agrumanes of ATGUISETPROP to 'GUIAPP' and 'LOOKUP' did not work. I'm still getting a blank. But I'm still playing with it!

I love learning curves!

Andy


A few minutes later: I decided to run the form from TCL with a RUN command instead of from the preview window.  It gave me a variable unassigned which was GUISTATE so I set it to null and it works now. But it still won't fill the list from the preview which I don't really care about. Now to get my events going.

Thanks for the help.

Andy
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: July 09 2007 at 6:03am
Hi Andy -

Setting the listbox contents in the startup section is the appropriate place. If you have a multi-form dialog, and use the Activate event to load the list contents, then every time the form is activated you would reload the list.

Did you change the name of your Application object in the GUI designer? Or the form name? When the code generator created the base subroutine for you, it used the current names of these objects. If the names have changed, you need to manually update the quoted strings in the generated code. Sometimes the "update code" tool will help you with this, but it only updates the event decoder and removes/adds event handlers.

Note: the preview window does not execute any of your code, so it will not load the list contents. It is intended to let you see how your design will appear, but not check its function.

Thanks,

Pete
Back to Top
dynamic View Drop Down
Senior Member
Senior Member


Joined: June 28 2007
Status: Offline
Points: 188
Post Options Post Options   Thanks (0) Thanks(0)   Quote dynamic Quote  Post ReplyReply Direct Link To This Post Posted: July 09 2007 at 8:02am
Thanks for the help Pete.

WooHoo! We have a GUI dialog lookup from a greenscreen! I have already installed it into several lookup programs... BUT

When the screen goes to GUI, it jumps up 1 line as if the enter key was pressed on the bottom line of the screen. My screen is set to 80,24. My cursor is not on the bottom line. Any ideas?

Andy
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: July 09 2007 at 8:38am
Hi Andy -

You probably have some code that is using one of AccuTerm special functions that ends with a CR, like executing a script, launching a DOS command, etc. If you simply use PRINT without a terminating colon, PRINT will terminate the line with CR LF. The CR is "eaten" by AccuTerm as part of the special command, but the LF is acted on and moves the cursor to the next line. That is why all the examples end the PRINT expression with a CR:, which supplies the required CR to terminate the function, but suppresses the default CR LF.

If this is happening from within the dialog subroutine, could you let me know what platform you are running for your host? Maybe there is a bug in one of the host-specific routines.

Thanks,

Pete
Back to Top
dynamic View Drop Down
Senior Member
Senior Member


Joined: June 28 2007
Status: Offline
Points: 188
Post Options Post Options   Thanks (0) Thanks(0)   Quote dynamic Quote  Post ReplyReply Direct Link To This Post Posted: July 10 2007 at 7:44am
Hi Pete,

I am running mvBase 2.0 on a Win2k server. It looks like the jump is happening in the ATGUIINIT2 routine. (See dialog box code below) I put a DEBUG  after line 69 of this program and it had not jumped by the time it got to it.  I moved the DEBUG to after line 74 and it had jumped by the time it got to it. When watching the screen it appears to jump just before the "This session is running a GUI application" message box appears. But what does that mean in realtime? As always thanks.

Andy

*-->BEGIN GUI HEADER<--*                                                             
069 * If GUISTATE is not NULL, assume GUI has been initialized                           
070 IF GUISTATE EQ '' THEN                                                               
071  CALL ATGUIINIT2(TEMPLATE<2,2>,'',GUIERRORS,GUISTATE)                                
072  IF GUIERRORS<1> >= 3 THEN RETURN                                                    
073 END                                                                                  
074 * Load the dialog project template                                                   
075 CALL ATGUIRUNMACRO(TEMPLATE,'',GUIERRORS,GUISTATE)                                   
076 IF GUIERRORS<1> >= 3 THEN RETURN                                                     
077 *-->END GUI HEADER<--*   
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: July 10 2007 at 9:52am
Hi Andy -

I found the problem that is causing the extra line feed. You can fix it by editing the FTVSINF program in FTBP. Look for this line:
INPUT RSP ON TIMEOUT RSP = '';*#MVBASE#*

Add a colon (:) after RSP so that the line looks like:
INPUT RSP: ON TIMEOUT RSP = '';*#MVBASE#*

Thanks,

Pete
Back to Top
dynamic View Drop Down
Senior Member
Senior Member


Joined: June 28 2007
Status: Offline
Points: 188
Post Options Post Options   Thanks (0) Thanks(0)   Quote dynamic Quote  Post ReplyReply Direct Link To This Post Posted: July 11 2007 at 3:55am
Thanks Pete,

Right now it looks like we will be using AccuTerm for Jet printing and GUIizing. We will be telling our customers to buy it if they want these features added to our application. I really appreciate you swift response to my questions and problems. Thanks.

Andy Wilson
Dynamic Software, Inc.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.