CnPack Forum


 
Subject: Bug in MessageBox Visual designer and C++ Builder
pazvante
新警察
Rank: 1



UID 42771
Digest Posts 0
Credits 6
Posts 2
点点分 6
Reading Access 10
Registered 2009-7-8
Status Offline
Post at 2009-7-8 17:56  Profile | Blog | P.M. 
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 ]
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2009-7-8 18:47  Profile | Blog | P.M. 
Thanks for your report. We'll correct this problem.
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2009-7-8 20:16  Profile | Blog | P.M. 
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
Top
pazvante
新警察
Rank: 1



UID 42771
Digest Posts 0
Credits 6
Posts 2
点点分 6
Reading Access 10
Registered 2009-7-8
Status Offline
Post at 2009-7-8 21:40  Profile | Blog | P.M. 
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 ]
Top
 




All times are GMT++8, the time now is 2024-11-23 20:50

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.008045 second(s), 7 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP