ShowMessage/MessagDlg wordwrap Delphi 2006 - Delphi XE [Edit]

Hi,

I have used Delphi 2006 up to now.
ShowMessage allowed a long text without a word wrapping.

Now with Delphi XE I notice that a migrated program shows smaller message window sizes and a previously carefully aligned message now appears wrapped and misaligned.

How to get back to the previous behaviour? I'm not experienced to create my custom form, so a code snippet may help.

Thanks,
Uli

Edited by: Ulrich Brueggemann on Sep 18, 2010 8:46 AM
0
Ulrich
9/18/2010 3:47:11 PM
embarcadero.delphi.win32 2183 articles. 0 followers. Follow

6 Replies
1590 Views

Similar Articles

[PageSpeed] 36

> I have used Delphi 2006 up to now.
> ShowMessage allowed a long text without a word wrapping.
> 
> Now with Delphi XE I notice that a migrated program shows smaller
> message window sizes and a previously carefully aligned message now
> appears wrapped and misaligned.
> 
> How to get back to the previous behaviour? 

Set UseLatestCommonDialogs (= a global variable in Dialogs.pas) to
False. This will return you to the old behaviour of using a VCL TForm
rather than a system API for message dialogs. As this variable will
impact file open and file save dialogs too however, an alternative is
to define your own ShowMessage procedure that calls
CreateMessageDialog, showing and freeing the form so created (check out
the D2006 VCL source for details - CreateMessageDialog itself shouldn't
have changed).
0
Chris
9/18/2010 6:52:07 PM
> {quote:title=Chris Rolliston wrote:}{quote}
> Set UseLatestCommonDialogs (= a global variable in Dialogs.pas) to
> False. This will return you to the old behaviour of using a VCL TForm
> rather than a system API for message dialogs. As this variable will
> impact file open and file save dialogs too however, an alternative is
> to define your own ShowMessage procedure that calls
> CreateMessageDialog, showing and freeing the form so created (check out
> the D2006 VCL source for details - CreateMessageDialog itself shouldn't
> have changed).

Hi Chris,

thanks, this has helped a lot.
As I can simply use a wrapper around ShowMessage and MessageDlg I can avoid fiddling around with CreateMessageDialog.
So a code like:

procedure MyShowMessage(s:string);
begin
  UseLatestCommonDialogs := false;
  ShowMessage(s);
  UseLatestCommonDialogs := true;
end;

already does the job. And open/save dialogs remain unchanged.

Regards, Uli
0
Ulrich
9/18/2010 7:28:24 PM
I would add try finally:

{code}
procedure MyShowMessage(s:string);
begin
  UseLatestCommonDialogs := false;
  try
    ShowMessage(s);
  finally
    UseLatestCommonDialogs := true;
  end;
end;

Just to be 200% sure that after the procedure the global variable has
correct value.
0
Lajos
9/18/2010 7:48:54 PM
Hello!

I also have to set 'UseLatestCommonDialogs' to False
and additionally set 'ofOldStyleDialog' property of Open and Save dialogs to true
if I want that open and save dialogs works in Windows 7
(otherwise they do not open at all).
It is also true that I reserve quite a lot of space for a stack:
{$M 16384, 60048576}
since I use recursive algorithms on large datasets.
Now I wonder what is the problem:

1. New dialogs are very space consuming, sometimes 
   they work at the beginning and after a set of open and save 
   dialogs executions it does not open dialogs any more
   (maybe also dialogs do not free memory after they are executed?)

2. There is a bug in Windows 7.

Anybody else experienced a similar problem?

It looks a little strange to work on Windows 7 with ancient dialogs
(they are even older that XP style, I think they look like in Windows NT).

Any suggestion will be very appreciated.

Thanks in advance.


> Set UseLatestCommonDialogs (= a global variable in Dialogs.pas) to
> False. This will return you to the old behaviour of using a VCL TForm
> rather than a system API for message dialogs. As this variable will
> impact file open and file save dialogs too however, an alternative is
> to define your own ShowMessage procedure that calls
> CreateMessageDialog, showing and freeing the form so created (check out
> the D2006 VCL source for details - CreateMessageDialog itself shouldn't
> have changed).
0
Petra
9/18/2010 8:05:11 PM
> As I can simply use a wrapper around ShowMessage and MessageDlg I can
> avoid fiddling around with CreateMessageDialog.

procedure ShowMessage(const Msg: string);
begin
  with CreateMessageDialog(Msg, mtCustom, [mbOK]) do
  try
    Position := poScreenCenter;
    ShowModal;
  finally
    Free;
  end;
end;
0
Chris
9/19/2010 10:00:52 AM
> Any suggestion will be very appreciated.

Apart from a vague recollection that others have posted about a similar
issue in the past, I don't have any, sorry. However, I can say for sure
that you're greatly increasing your chances of no one else chipping in
by not starting a new thread. The culture of these forums is very much
'one question per thread', so repost your question as a thread starter
in its own right. Also, delphi.vcl.components.using would be a better
group, so post it there rather than here.
0
Chris
9/19/2010 10:19:37 AM
Reply:

Similar Artilces:

Editable/Not Editable
Hello All, I have some webform(.aspx page) in which i have some controls (for input) and i would like to make that screen editable/not editable based on some condition. how can i do that.  the whole intent is user can read the information but can't change.  shiva kumar If you want to make the controls editable/non-editable, you can set their ReadOnly property to true or false accordingly. What exactly do you imply by making the screen editable/non-editable?Thanks,MaxLet Me Google That For You! i mean to say i would like to show the current values but user should not mod...

Edit but no edit
I've Created a custom module and reuse the survey.dnn file to help with the install here it is. <?xml version="1.0" encoding="utf-8" ?> <dotnetnuke version="2.0" type="Module"> <folders> <folder> <name>CompanyName - Photos</name> <description>Photos allows you to add photo albums</description> <version>01.00.00</version> <modules> <module> <friendlyname>CompanyName - Photos</friendlyname> <controls> <c...

To edit or no to edit
Jon, Can I edit, whatever I've written so far, so that it doesn't look like I wrote utterly crap?-) -- Pieter "Linux is like living in a teepee. No Windows, no Gates, Apache in house." -- Usenet signature Pieter Zijlstra wrote: > Jon, > > Can I edit, whatever I've written so far, so that it doesn't look like > I wrote utterly crap?-) Oh boy, the edit button vanished from the web-forum ... ;-) -- Pieter "Humor is also a way of saying something serious." -- T. S. Eliot (1888 - 1965) Pieter Zijlstra wrote: ...

TX and RX using socket (Ethernet port) using BCB C++ 2006 Edition [Edit]
Hi All, I'm using BCB C++ 2006 edition. Kindly let me know how to carry out TX and RX in sockets(C++ Builder). I'm a newbee to the BCB world. Kinly post the code or pseudocode if possible. Thanks. Edited by: guddappa th on Jan 5, 2011 8:09 AM ...

[PATCH] Move Win32 from win32/ext/Win32 to ext/Win32
To compile the Win32 module under both "MSWin32" and "cygwin" the module needs to be moved to the ext/ subdirectory. To preserve the change history this should be done with `p4 integrate`: p4 integrate win32/ext/Win32/... ext/Win32/... p4 delete win32/ext/Win32/... The attached patch then updates Configure to build the module under cygwin only, and updates the MANIFEST. The MSWin32 builds will continue to find the module automatically using the FindExt.pm module. Cheers, -Jan diff -dur bleadperl/Configure bleadnew/Configure --- bleadperl/Conf...

re: [PATCH] Move Win32::* functions from win32/win32.c to ext/Win32/Win32.xs
----=_e3pon25ktlh8mqd3tgjj1tt7en166ucrfq.MFSBCHJLHS Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > patch2.diff moves the Win32::* functions into the ext/Win32 module and > adds forwarder functions to load the module at runtime on first use: > > static void > forward(pTHX_ const char *function) > { > dXSARGS; > Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn("Win32",5), NULL); > PUSHMARK(SP-items); > call_pv(function, GIMME_V); > } It just occurred to me that Perl_load_modul...

Where is ipWorks in XE? [Edit]
The product sheet says it includes full version of ipWorks in RAD studio XE. Yet, after installation it is not in the component palette. Is there any additional step required to see or install it? Edit: found it, no help needed. ...

RTTI in XE [Edit]
We've got some code that looks similar to this: {code} TSomeClass = class(TComponent) Fsl : TStringList; public .. . . property someData[ s : string ] : string read GetData write SetData; default; .. . . end; function TSomeClass.GetData( index : string ) : string; begin .. . . Result := Fsl.strings[ Fsl.IndexOf(index) ]; .. . . end; {code} elsewhere, we have: {code} var s : string; aa : TSomeClass; .. . . s := aa[ some_string_argument ]; {code} The trouble is, the values used as arguments to 'aa' just above ( aa[ some_string_argument ] ...

What is with the " [Edit] [Edit] [Edit]" posts?
Don't know where I should post this, hopefully a short thread here is okay. But, at least with my newsreader, Agent 6, longer threads tend to get broken into pieces, with "[Edit]" attached to the topic name. And sometimes longer threads then get [Edit] [Edit] and then [Edit] [Edit] [Edit] For example, here is a current thread: FastMM 4.96 available [Edit] [Edit] [Edit] How does this happen? Can I make them show up as one thread? Paul Doland wrote: > Don't know where I should post this, hopefully a short thread here is > okay. But, at least with my...

XE
Unless I'm missing something, I can't believe that, as of XE, the Delphi IDE still does not allow horizontal split screen editing. I think that every editor I use, both windows and mac, has this feature. Prism has it. I know, that's the VS IDE, but come on EMBT, let's get with the times here. -- Kevin Powick > {quote:title=Kevin Powick wrote:}{quote} > Unless I'm missing something, I can't believe that, as of XE, the > Delphi IDE still does not allow horizontal split screen editing. > > I think that every editor I use, both windows ...

Rad Studio XE [Edit]
I just finished watching a video for XE and I thought, "Oh man, they're adding cool stuff, but I don't hear them talking about Delphi Prism at all!" Then at the very end they DID say that the profiling and stuff also worked for Delphi Prism. That was great to hear. I was afraid I was going to miss out on the enhancements. Looks like they are really doing some nice improvements to the products. Mark Tiede wrote: > I was afraid I was going to miss out on the enhancements. Looks like > they are really doing some nice improvements to the products. Glad you lik...

debugging project in XE [Edit]
It seems I am having issues with debugging my projects in Delphi XE. When I attempt to run the program, I receive an error stating that the module cannot be found. If I build the program, and then run the executable outside of the IDE, it works fine. I have tried to look at the code, however, I am not even making it past initially creating my first form. I have some code in the on create event of the form, but it does not even make it to that code. I can debug a new program if I start from scratch, but not any program that was written with a previous version of Delphi. I have looked at...

Test edit [Edit]
Test edit 3 Edited by: quinn wildman on Feb 5, 2009 10:23 AM Edited by: quinn wildman on Feb 5, 2009 10:23 AM This reply sent via http 30 minutes after original post. Original post still not displaying in nntp.. > {quote:title=quinn wildman wrote:}{quote} > Test edit 3 > > Edited by: quinn wildman on Feb 5, 2009 10:23 AM > > Edited by: quinn wildman on Feb 5, 2009 10:23 AM ...

ShowMessage with Windows8.1 [Edit]
Hi, I have just been foolhardy enough to upgrade my OS. The only problem I can see is that some of my messages appear with a totally black rectangle in the middle, so you cannot see the text or the OK button. This does not happen for the first messge of the run , but for 2 or 3 subsequent ones. Then the problem goes away. Does anyone have any ideas about this? George PS Ignore the comment about the first message ; that was different. Edited by: george probyn on Jan 10, 2014 5:09 AM I would suggest upgrading the graphics driver for your video card as a first thing to test. Otherwise...

XE FormatString problem. [Edit]
Hello all, Normal this code below was working fine with RAD C++ Builder 2009/2010 but with XE version It results with '-2-" instead of "-2010-01-30-", how can I easily modify those lines. I hate that w_char problem and again it is here with XE version and I dont want to use wcstombs(...) if it is possible. ----------------------------------------------- TDateTime DT; char s[255]; .... sprintf(s, "-%s-", DT.FormatString("yyyy-mm-dd").t_str() ); ----------------------------------------------- Edited by: YILMAZ YORU on Oct 11, 2010 4:48 A...

Web resources about - ShowMessage/MessagDlg wordwrap Delphi 2006 - Delphi XE [Edit] - embarcadero.delphi.win32

Delphi (programming language) - Wikipedia, the free encyclopedia
Delphi's compilers use their own Object Pascal dialect of Pascal and generate native code for several platforms: 32- and 64-bit Windows , 32-bit ...

Galaxie - Your musical universe - Home
CAN - EN CAN - FR CAN - EN USA - EN Become a member Log in Home Channels Rock Adult Alternative Canadian Indie Canadiana Classic Rock Franco ...

电力谐波治理装置数据采集处理系统设计
1 引言   在信息科学中,数据采集技术已经成为其重要的一个研究问题,它已经与计算机技术、网络技术、传感器 ...

bbs.qbnews.cn - Database Error
Discuz! Database Error The database has encountered a problem. Need Help? Error messages: [Type] 查询语句错误 [1064] You have an error in your SQL ...

ext/snarl: PHP interface to the Windows Snarl Notification Tool API
It’s far from rocket science, but this small extension I wrote over the Holidays allows PHP to send messages to the Snarl Notification Tool . ...

A Windows 10 UWP app to receive temperature data from a Raspberry PI2 and control a fan using the Azure ...
Intro You cannot deploy apps to a Microsoft Band directly, so there is always a kind of app running on the device to which it is paired on which ...

Iranian Perspective On The Alexander Movie
Just came across this very interesting email, reproduced in full below... ********** http://iranscope.ghandchi.com/Anthology/kavehfarrokh.htm ...

Google Answers: Hair removal
Hi, Since I live in India, I know about two instances: 1. Amongst Hindus in the case of death of a father, the eldest son isto remove his hair ...

Chemtrail Patents: Bernard Eastlund Patent 4,686,605
Omega - Atmospheric Geoengineering is occurring in our skies daily, and on a worldwide basis. For those who doubt the feasibility of these special ...

Tim Anderson's ITWriting
IE7 pops up this "Stop running this script" dialog when my code is running. Nor will it let go. You click "No", and 1 second later the dialog ...

Resources last updated: 12/17/2015 5:34:40 PM