Board logo

Subject: Bug in MessageBox Visual designer and C++ Builder [Print This Page]

Author: pazvante    Time: 2009-7-8 17:56     Subject: Bug in MessageBox Visual designer and C++ Builder

The code generated by the MessageBox Visual designer for MessageDlg and C++ Builder is sometimes incorrect.

For example instead of
MessageDlg("text", mtConfirmation, [mbOK], 0);

it should be
MessageDlg("text", mtConfirmation, TMsgDlgButtons() << mbOK, 0);

The same for
MessageDlg("text", mtConfirmation, [mbYes, mbNo], 0);
MessageDlg("text", mtConfirmation, [mbRetry, mbCancel], 0);

it should be
MessageDlg("text", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0);
MessageDlg("text", mtConfirmation, TMsgDlgButtons() << mbRetry << mbCancel, 0);

Tested with CnWizards_0.9.2.522 and BCB 6.0.

BTW, thank you for a great addon!

[ Last edited by  pazvante at 2009-7-8 17:58 ]
Author: Passion    Time: 2009-7-8 18:47

Thanks for your report. We'll correct this problem.
Author: Passion    Time: 2009-7-8 20:16

Please try our latest nightly build 0.9.2.525? It fixed this problem.

http://www.cnpack.org/downbuilds.php

or

http://code.google.com/p/cnpack/downloads/list?can=1
Author: pazvante    Time: 2009-7-8 21:40

Thanks for the quick reply!
Tested build 525 and it works.
One note though.
There are some #defines in Dialogs:
ConstantMeaning
mbYesNoCancelmbYes, mbNo, and mbCancel
mbYesNoAllCancelmbYes, mbYesToAll, mbNo, mbNoToAll, and mbCancel
mbOKCancelmbOK and mbCancel
mbAbortRetryIgnorembAbort, mbRetry, and mbIgnore
mbAbortIgnorembAbort, mbIgnore
that can be used instead (like the previous version did)
So
MessageDlg("text", mtConfirmation, TMsgDlgButtons() << mbAbort << mbRetry << mbIgnore, 0);
becomes
MessageDlg("text", mtConfirmation, mbAbortRetryIgnore, 0);

The only messages that failed were the ones (3) mentioned by me in the 1st post. Everything else worked fine.

You can leave it like it is now or you can change to use TMsgDlgButtons() only where absolutely needed (like GExperts does).

[ Last edited by  pazvante at 2009-7-8 21:43 ]




Welcome to CnPack Forum (http://bbs.cnpack.org/) Powered by Discuz! 5.0.0