Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dialog box

8 views
Skip to first unread message

Jim Wilson

unread,
Sep 12, 1996, 3:00:00 AM9/12/96
to

Turbo C++ 4.5 Owl 2.5
Help needed:
In my program when the user makes a menu selection, I want to have a
dialog box pop up with the message "reading data". As of this point
the dialog pops up, but I"m not sure what windows message to trap in
order to read in the data.

I'm using the SetupWIndow() function to initialize the location of the
dialog. HOw would I cause the dialog box to display itself and then
read in the files and then quit when finished.

Thanks

jwil...@primenet.com
Mr GoodFish <><


Grady Dill

unread,
Sep 12, 1996, 3:00:00 AM9/12/96
to

You need to have a function mapped to the menu item. W/in the function,
use a modeless dialog. Display the modeless dialog at the beginning, read
your file(s) in, and then get rid of the modeless dialog.

Grady

Erwin Lotter

unread,
Sep 16, 1996, 3:00:00 AM9/16/96
to

jwil...@primenet.com (Jim Wilson) wrote:

>Turbo C++ 4.5 Owl 2.5
>Help needed:
>In my program when the user makes a menu selection, I want to have a
>dialog box pop up with the message "reading data". As of this point
>the dialog pops up, but I"m not sure what windows message to trap in
>order to read in the data.

Hi Jim,
if I understand your problem right, you do not know how to get your
dialog displayed while reading the data. I would suggest to do the
reading in your app and use the dialog only for displaying the
message. You can have display updates done by calling
GetApplication()->PumpWaitingMessages() from time to time when doing a
time-consuming job. To remove the Dialog send a IDOK command or call
it's CmOK member function.


Erwin Lotter


Phillip Stubbs

unread,
Sep 17, 1996, 3:00:00 AM9/17/96
to


.
.


> GetApplication()->PumpWaitingMessages() from time to time when doing a
> time-consuming job. To remove the Dialog send a IDOK command or call
> it's CmOK member function.
>
>
>

Just a question here. If you call PumpWaitingMessages, won't the user be
able to close the dialogue box by pressing the OK button themselves.

Phil


Shanti Rao

unread,
Sep 18, 1996, 3:00:00 AM9/18/96
to

Stolen from Tips, Tricks, & Traps:

Make a class system like this, then override TProcess::Run();

Better, conditionally derive TProcess from TThread(if possible),
and conditionally run asynchronously, sending feedback information to the
dialog box, update a progress bar, etc...

class TProcess
{ private:
bool stopflag;
protected:
bool ShouldAbort();
{GetApplicationObject;->PumpWaitingMessages();
return stopflag;
}
public:
virtual bool Run(); {return false;}
TProcess();{}
virtual ~TProcess();{}
void Terminate(); {stopflag = true;}
friend TDialogProcess;
};

class TDialogProcess : public TDialog
{ public:
TProcess * CurrentProcess;
TDialogProcess(TWindow *parent, TModule * module=0);
~TDialogProcess();
protected:
void IdAbort(); {CurrentProcess->stopflag = true;}
virtual bool CanClose(); {return false;}
public:
virtual bool Start(TProcess &process);
{ CurrentProcess = &process;
return process.Run();}
DECLARE_RESPONSE_TABLE(TDialogProcess);
};


In article <01bb5a8c$ffbe3f40$a52b...@pluto.the-td.co.uk>, "Phillip Stubbs"

Erwin Lotter

unread,
Sep 18, 1996, 3:00:00 AM9/18/96
to

"Phillip Stubbs" <Ph...@the-td.co.uk> wrote:
> .
>> GetApplication()->PumpWaitingMessages() from time to time when doing a
>> time-consuming job. To remove the Dialog send a IDOK command or call
>> it's CmOK member function.
>Just a question here. If you call PumpWaitingMessages, won't the user be
>able to close the dialogue box by pressing the OK button themselves.
>Phil
That's right. But to avoid closing the dialog you shouldn't lock the
system (Win16). Better is to handle such actions in the dialog. For
example the dialog could send a message to the app when the
Cancel button is pressed or something like that.

Erwin


I spend entirely TOO MUCH time on the net.

unread,
Sep 18, 1996, 3:00:00 AM9/18/96
to

"Phillip Stubbs" <Ph...@the-td.co.uk> wrote:

> .
> .
>> GetApplication()->PumpWaitingMessages() from time to time when doing a
>> time-consuming job. To remove the Dialog send a IDOK command or call
>> it's CmOK member function.

>Just a question here. If you call PumpWaitingMessages, won't the user be
>able to close the dialogue box by pressing the OK button themselves.

not if you don't include one. and you can disable the close box also,
and the CLOSE system menu command.

>Phil


--
Steven J. Sobol, Head Geek Personal: http://junior.apk.net/~sjsobol
North Shore Technologies North Shore Technologies ELECTRIC AVE.:
Cleveland, OH http://www.nstc.com (both under construction)
Web Consulting, PC Sales e-mail: sjs...@nstc.com or sjs...@apk.net
Win3.1/Win95 Programming (Speak for North Shore? I *AM* North Shore. :)


Sasa Markovic

unread,
Sep 21, 1996, 3:00:00 AM9/21/96
to

sjs...@nstc.com (I spend entirely TOO MUCH time on the net.) wrote:

>not if you don't include one. and you can disable the close box also,
>and the CLOSE system menu command.

A short example would be apriciated.
-------------
Sasa Markovic
Faculty of Mechanical Engineering, Belgrade
sa...@eunet.yu


Sasa Markovic

unread,
Sep 21, 1996, 3:00:00 AM9/21/96
to

Reposting article removed by rogue canceller.
0 new messages