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 <><
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
>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
.
.
> 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
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
> .
> .
>> 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. :)
>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