![]() |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
Create you Dialog/Form and call it by using ShowModal
|
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
[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. |
|
#7
|
|||
|
|||
|
And Yes it will stop
|
|
#8
|
|||
|
|||
|
Ahhh I see. I haven't played around with those properties before. I'll give it a shot and see what happens.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|