Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-10

Default caption in MessageDlg()

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

I just noticed that if I do a

  MessageDlg('Some ErrorMessage', mtError, [mbOk], 0) ;

(so I do not specify a custom caption for the dialog) then the caption of the dialog is the Application.Title, whereas in Delphi (at least in D1 to D3) it depends on the DialogType, so in Delphi the caption of the dialog in my example would be "Error"

I just tested an existing executable, compiled with a previous version of Lazarus, and this code:

    MessageDlg(Format(msgSourceDirNotFound,
                       [ExcludeTrailingPathDelimiter(SourceEdit.Text)]),
                       mtError, [mbOk], 0);

will bring up a Dialog with "Error" as the caption.

I'm using Lazarus from SVN revision 16824.

Is this new behaviour by design (which would force me to rewrite almost all my projects to use the MessageDlg(aMsg, aTitle, DlgType, Buttons, HelpCtx) format instead), or is it a bug?

Bart

Reply by email

Vincent Snijders
to Bart
Bart wrote 23 lines
I just noticed that if I do a MessageDlg('Some ErrorMessage', mtError, [mbOk], 0) ; (so I do not specify a custom caption for the dialog) then the caption of the dialog is the Application.Title, whereas in Delphi (at least in D1 to D3) it depends on the DialogType, so in Delphi the caption of the dialog in my example would be "Error" I just tested an existing executable, compiled with a previous version of Lazarus, and this code: MessageDlg(Format(msgSourceDirNotFound, [ExcludeTrailingPathDelimiter(SourceEdit.Text)]), mtError, [mbOk], 0); will bring up a Dialog with "Error" as the caption. I'm using Lazarus from SVN revision 16824. Is this new behaviour by design (which would force me to rewrite almost all my projects to use the MessageDlg(aMsg, aTitle, DlgType, Buttons, HelpCtx) format instead), or is it a bug?

This was changed 2007-06-13 11:34 vincents r11317.

I cannot find the exact reason for the change. I have no objection to revert it.

Vincent

Reply by email

Henrique Faria
to Bart
Show quoted text 9 lines
> I cannot find the exact reason for the change. I have no objection to > revert it. > > Vincent Since I had nothing better to do I submitted a patch in the bugtracker. Bart

The possibility to edit the caption in a messagedlg can help on internationalization matter.

Is there a better way to change the buttons instead of editing the "lclstrconsts.pas" ?

Henrique.

_________________________________________________________________ Receba GR?TIS as mensagens do Messenger no seu celular quando voc? estiver offline. Conhe?a o MSN Mobile! http://mobile.live.com/signup/signup2.aspx?lc=pt-br -------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081102/8a949b88/attachment.html

Reply by email

Vincent Snijders
to Henrique Faria
Henrique Faria wrote 15 lines
> > > I cannot find the exact reason for the change. I have no objection to > > revert it. > > > > Vincent > > Since I had nothing better to do I submitted a patch in the bugtracker. > > Bart The possibility to edit the caption in a messagedlg can help on internationalization matter. Is there a better way to change the buttons instead of editing the "lclstrconsts.pas" ?

Load the correct lcl.*.po file at runt time.

Vincent

Reply by email

Henrique Faria
to Bart: Since I had nothing better to do I submitted a patch in the bugtracker. Bart
Show quoted text 9 lines
> I cannot find the exact reason for the change. I have no objection to > revert it. > > Vincent Since I had nothing better to do I submitted a patch in the bugtracker. Bart

The possibility to edit the caption in a messagedlg can help on internationalization matter.

Is there a better way to change the buttons instead of editing the "lclstrconsts.pas" ?

Henrique.

_________________________________________________________________ Cansado de espa?o para s? 50 fotos? Conhe?a o Spaces, o site de relacionamentos com at? 6,000 fotos! http://www.amigosdomessenger.com.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081103/3e8cb84f/attachment.html

Reply by email

Vincent Snijders
to Henrique Faria
Henrique Faria wrote 16 lines
> > > I cannot find the exact reason for the change. I have no objection to > > revert it. > > > > Vincent > > Since I had nothing better to do I submitted a patch in the bugtracker. > > Bart The possibility to edit the caption in a messagedlg can help on internationalization matter. Is there a better way to change the buttons instead of editing the "lclstrconsts.pas" ?

See previous answer:
http://www.lazarus.freepascal.org/pipermail/lazarus/2008-November/020856.html

Vincent

Reply by email