Board index » delphi » questions: Delphi and Direct-X, message box colors, and controlling procedure to manage phases in a program

questions: Delphi and Direct-X, message box colors, and controlling procedure to manage phases in a program

Hello
I am making a program that has different phases in it, like:
DO
  Phase 1
  Phase 2
Until Done
(this is pseudocode)

I am using Delphi 6, and my application has a main form and two manus, one
for phase 1 and one for phase 2, and I know how to switch menus when
necessary.
My question is this: This is a Windows program responding to messages from
menus, components, etc., like any Windows program, but I wanted some kind of
'controlling procedure' that would do something like:

While NOT DONE DO
  BEGIN
    Phase 1;
    Phase 2;
  END;

In a DOS program it is easy, just call procedure Phase1 and procedure Phase2
when needed.
But in a Windows program, there is no such 'controlling procedure'
The menus in my Windows program will have an 'End Phase' menu item, which
when selected, and a confirming messagebox is answered Yes, the phase would
end and this controlling procedure would go to the next phase.

Can someone suggest the best way to accomplish this?
This sounds to me like it may be similar to the answer to the post
'Capturing KeyPresses' above.

A 2nd questions is, where can I find information on using Direct-X in a
Delphi game? Where can I find a good DX-8 component set?

Third, is it possible to have a Application.MessageBox be a different color
than Windows gray?

Please answer these if possible.

Thanks,

Gino

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 

Re:questions: Delphi and Direct-X, message box colors, and controlling procedure to manage phases in a program


Hello
It's me Gino.
I may have answered my first question and I wanted advice if my answer is a
good answer or if it is not, what would be better?
This is related to a 'controlling procedure'.
I defined a unit-global variable, bDone : Boolean and have something like

procedure TForm1.LOOPS;
var
iLoop : Integer;
begin

  bDone := False;
  while bDone = false do
  begin
    Application.ProcessMessages;
    Button1.Caption := 'A';
  end;
end;

and in the Button1 Click event I have the statement:
bDone := True;

This works for me in that when I click the button the procedure exits and
not before. My question is, with the spinning While loop going on while the
rest of my program executes, will this cause problems or use a lot of system
resources? Will Application.ProcessMessages; cause problems?
I hope someone can hlpe, and I still need answers to my other two questions.

Gino

Quote
"Gino Costa" <gco...@beld.net> wrote in message

news:3bcdd1e4$1_1@corp.newsgroups.com...

Quote
> Hello
> I am making a program that has different phases in it, like:
> DO
>   Phase 1
>   Phase 2
> Until Done
> (this is pseudocode)

> I am using Delphi 6, and my application has a main form and two manus, one
> for phase 1 and one for phase 2, and I know how to switch menus when
> necessary.
> My question is this: This is a Windows program responding to messages from
> menus, components, etc., like any Windows program, but I wanted some kind
of
> 'controlling procedure' that would do something like:

> While NOT DONE DO
>   BEGIN
>     Phase 1;
>     Phase 2;
>   END;

> In a DOS program it is easy, just call procedure Phase1 and procedure
Phase2
> when needed.
> But in a Windows program, there is no such 'controlling procedure'
> The menus in my Windows program will have an 'End Phase' menu item, which
> when selected, and a confirming messagebox is answered Yes, the phase
would
> end and this controlling procedure would go to the next phase.

> Can someone suggest the best way to accomplish this?
> This sounds to me like it may be similar to the answer to the post
> 'Capturing KeyPresses' above.

> A 2nd questions is, where can I find information on using Direct-X in a
> Delphi game? Where can I find a good DX-8 component set?

> Third, is it possible to have a Application.MessageBox be a different
color
> than Windows gray?

> Please answer these if possible.

> Thanks,

> Gino

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

Other Threads