![]() |
| The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum. |
|
Post Reply
|
| Author | ||
dynamic
Senior Member
Joined: June 28 2007 Status: Offline Points: 188 |
Post Options
Thanks(0)
Quote Reply
Topic: GUI popups from greenscreenPosted: 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 |
||
![]() |
||
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
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 |
||
![]() |
||
LiveBlues
Groupie
Joined: February 28 2005 Status: Offline Points: 93 |
Post Options
Thanks(0)
Quote Reply
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? |
||
![]() |
||
dynamic
Senior Member
Joined: June 28 2007 Status: Offline Points: 188 |
Post Options
Thanks(0)
Quote Reply
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 |
||
![]() |
||
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
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 |
||
![]() |
||
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
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 |
||
![]() |
||
dynamic
Senior Member
Joined: June 28 2007 Status: Offline Points: 188 |
Post Options
Thanks(0)
Quote Reply
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 |
||
![]() |
||
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
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 |
||
![]() |
||
dynamic
Senior Member
Joined: June 28 2007 Status: Offline Points: 188 |
Post Options
Thanks(0)
Quote Reply
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 |
||
![]() |
||
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
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 |
||
![]() |
||
dynamic
Senior Member
Joined: June 28 2007 Status: Offline Points: 188 |
Post Options
Thanks(0)
Quote Reply
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<--* |
||
![]() |
||
PSchellenbach
Admin Group
Moderator Joined: December 15 2003 Location: United States Status: Offline Points: 2150 |
Post Options
Thanks(0)
Quote Reply
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:
Add a colon (:) after RSP so that the line looks like:
Thanks, Pete |
||
![]() |
||
dynamic
Senior Member
Joined: June 28 2007 Status: Offline Points: 188 |
Post Options
Thanks(0)
Quote Reply
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. |
||
![]() |
||
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |