Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QDialogs - MessageDlg not functioning anymore ??? 1

Status
Not open for further replies.

BobbaFet

Programmer
Feb 25, 2001
903
NL
For the reason of needing to have a inputbox thatll just take integers to a certain amount, I was required to put
QDialogs in my uses clause, but now this doesn't work anymore:

Code:
procedure TGRManager.btSavePlayerServerInfoClick(Sender: TObject);
begin
memoFileLoader.Clear;
memoFileLoader.Lines.LoadFromFile(GRPath + '\options.xml');
if MessageDlg('Would you like to save the changes made?',mtConfirmation,[mbYes,mbNo],0) = mrYes then
        begin
        if chbPlayerName.Checked then
                begin
                memoFileLoader.Lines[102] := '<PlayerName>' + edPlayerName.Text + '</PlayerName>';
                chbPlayerName.Checked := False;
                end;
                
        if chbServerName.Checked then
                begin
                memoFileLoader.Lines[78]  := '<MPGameName>' + edServerName.Text + '</MPGameName>';
                chbServerName.Checked := False;
                end;

        if chbServerMOTD.Checked then
                begin
                memoFileLoader.Lines[79]  := '<MOTD>' + edServerMOTD.Text + '</MOTD>';
                chbServerMOTD.Checked := False;
                end;

        if chbAllowRemoteAccess.Checked then
                begin
                memoFileLoader.Lines[84]  := '<RemoteServerAccess>' + cobAllowRemoteAccess.Text + '</RemoteServerAccess>';
                chbAllowRemoteAccess.Checked := False;
                end;

        if chbRemoteAccessPassword.Checked then
                begin
                memoFileLoader.Lines[85]  := '<RemoteServerPasswd>' + edRemoteAccessPassword.Text + '</RemoteServerPasswd>';
                chbRemoteAccessPassword.Checked := False;
                end;

        if chbPreferredIP.Checked then
                begin
                memoFileLoader.Lines[83]  := '<PreferredIP>' + edPreferredIP.Text + '</PreferredIP>';
                chbPreferredIP.Checked := False;
                end;

        //memoFileLoader.Lines.SaveToFile(GRPath + '\options.xml');
        ShowMessage(memoFileLoader.Text);
        end;
end;

Ive tried it without the messagedlg and it works fine so the rest of my code is good, Ive tried changing it to the
following:

Code:
if MessageDlg('Would you like to save the changes made?',mtConfirmation,[mbYes,mbNo],0,mbYes,nil) = mrYes then

But that doesnt work either, can someone help me?

Thanx allot,

[bobafett] BobbaFet [bobafett]

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
Hi Bobbafet,

does it work if you use Dialog.MessageDlg ?

--------------------------------------
What You See Is What You Get
 
I mean Dialogs.MessageDlg (dialogs = the unit name)

--------------------------------------
What You See Is What You Get
 
Thanx for the tip! I've gotten it to work :)

So now in Delphi 7 Enterprise when using QDialogs and you want to use the one in Dialogs you'll have to write it like this:

if Dialogs.MessageDlg('Message',Dialogs.mtInformation,[Dialogs.mbYes,Dialogs.mbNo],0) = mrYes then
showmessage('it works!');

(A pain in the rear but it works)

Here, have a star! :)

[bobafett] BobbaFet [bobafett]

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top