Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2006, 11:19 PM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default Message Dialogs and creating ones own.

It's been awhile since I have played around with Delphi so I am a little out of touch, plus I have never attempted anything quite like this before.

But basically, Using MessageDlgPos won't cut it as the predefined button captions are no good, they are confusing the user as I need different captions for them. Although I suppose there probably is a way to change those, I am instead creating a new form for this so it will also suit the GUI.

What I am looking to do is effectively mimic the functionality of that function I was using (MessageDlgPos), so I can call that function and have the form I created in the project popup and return a result from what they pressed (eg: do this, do that, do other, cancel) and then close the form and proceed. Just like with using MessageDlgPos or other variants.

Does anyone have a clue how to go about this? The main thing is that I want to display this confirmation at several stages of use in the application, wait for the returned result and only then continue processing.
Reply With Quote
  #2  
Old 09-25-2006, 12:41 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 4,773
Default RE: Message Dialogs and creating ones own.

If the goal is to change the standard MessageDialog then see [link]http://www.swissdelphicenter.ch/en/showcode.php?id=1241[/link]

Regards,
Abdulaziz Jasser
Reply With Quote
  #3  
Old 09-25-2006, 12:57 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: Message Dialogs and creating ones own.

Well no, rather i'd like to create my own form with controls and mimic the MessageDialog.

Basically I just want to be able to halt processing when I open the form, until it's closed and sends me some feedback (as to what the user chose) and then continue processing.

Much like how the Dialog functions work.
Reply With Quote
  #4  
Old 09-25-2006, 12:59 AM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: Message Dialogs and creating ones own.

Create you Dialog/Form and call it by using ShowModal
Reply With Quote
  #5  
Old 09-25-2006, 01:13 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: Message Dialogs and creating ones own.

So when I display it, I make sure it is opened using ShowModal and this will halt any processing?

But how do I handle the information being sent back and forth.

Like how would I handle a function that opens the form, gets the feedback, closed the form and returns the result?

Like uhhh.....

My Proc()
Var
Form_Result: Byte;
Begin
// Some stuff going on here.
Form_Result := OpenMyForm();
// Now continue on doing things here.
End;

So that Form_Result may be filled with some sort of byte value, such as 1, 2, 3, 4 for the 4 different buttons from left to right respectively.

Just trying to understand what I need to do to get this working.
Reply With Quote
  #6  
Old 09-25-2006, 01:23 AM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: Message Dialogs and creating ones own.

[DELPHI]var
MyValue : Integer;

if Form2.ShowModal = mrOK then
begin
MyValue := Form2.TheValue;
end;[/DELPHI]


When you place buttons on Form2 set their modal results
to eg: mrOK MrCancel etc.
Reply With Quote
  #7  
Old 09-25-2006, 01:24 AM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: Message Dialogs and creating ones own.

And Yes it will stop
Reply With Quote
  #8  
Old 09-25-2006, 01:26 AM
Chesso Chesso is offline
Senior Member
 
Join Date: May 2004
Location: Sydney, Australia
Posts: 1,199
Default RE: Message Dialogs and creating ones own.

Ahhh I see. I haven't played around with those properties before. I'll give it a shot and see what happens.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:38 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.