MsgBox for status information

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

MsgBox for status information

Post by Susan Smith »

I bet this is a long shot...

I'm updating some very old progams. Is there a way to use MSGBOX to display a message on the screen while a process is going on without stopping execution of the program to wait for a mouse click on a button?

I'd like to display a msgbox while I'm sorting a long file that says something like "Processing...please wait" or something more informative so the user doesn't see a blank screen and wonder if it has hung. I'd love to use a progress meter but I can't update it during the sort process. Currently, I'm just printing the message text to the screen without any borders, which doesn't look all that pretty. I could display a child WINDOW with the message in it. Is that a better idea?

-- Susan
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

The standard msgbox will interrupt the program while it is displayed.

You can launch a NOPARENT window with the message in it and then close the window when done.

Or, you could possible use AUTOIT to launch a message box and then kill itself when a new title appeared

Or you could spawn another session that displayed the message

Of the above options I believe the NOPARENT window would be the easiest to manage and yeild the most efficient results. Set it as a function that returns the number of the window as the value of the function. When your routine finishes then close that window


01010 let waitwin=fnwait("Please wait - processing")
01020
01900
01910 close #waitwin: !:waitwin=0


def library fnwaitwin(message$*1000)
library env$("PD")&"vol002\fnsnap.dll":fngethandle
open #(waitwin:=fngethandle):"srow=2,scol=2,rows=3,cols="str$(min(70,len(message$))),display,outin
print #waitwin, fields "2,&str$(min(70,len(message$))/2)&",cc ,N/W:T":message$
fnend

Or something like that.

FNGeorge
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

A few syntax errors in the above example. Use the attached.

Of course you must have FNSNAP.dll installed.
Attachments
pinp.br
(1.57 KiB) Downloaded 509 times
pinp.br
(1.57 KiB) Downloaded 519 times
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Thanks George. I hadn't thought of using NO PARENT. In fact, this is one BR 4.2 feature that I haven't tried out at all yet. Is there a benefit to using this method over just opening a regular child window and displaying a message in it?

-- Susan
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

The benefit of using NOPARENT is that it opens a completly seperate moveable window, so you can make it look just like a real message box.

Gabriel
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Oh of course. I forgot that MSGBOX is movable. Thanks. That's the part I was missing.

-- Susan
bluesfannoz
Posts: 292
Joined: Fri Jun 19, 2009 9:01 am
Location: Lawrence, Kansas
Contact:

Post by bluesfannoz »

I had an example of a Progress bar using an No-Parent window at the last conference. I will also be talking further about using the No-Parent windows for Message boxes at the upcoming conference.

Steve
Steve Koger
Computer Specialist
SEKESC-MACS Division
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

That's wonderful Steve. I look forward to it.

-- Susan
Post Reply