AdvSmoothMessageDialog access violation

Hi, I have to write the message and sometimes I have to update it with the dialog already visible. I tried to do close first but if the dialog is not visible I get an access violation.
How can I know if the dialog is already visible or how can I close it before changing the text?
Thanks!

Hello,

I will need more information on what you exactly do, as I'm not able to reproduce your issue.
What version of the TMS VCL UI Pack are you using and with which Delphi version?

If it is possible, it would be really helpful if you could create a sample project for us to test.

Another thing that I noticed is that I am able to update the dialog text or add buttons without closing the dialog. For example: AdvSmoothMessageDialog1.HTMLText.Text := 'Other Text';

rad studio 10.1 (c++) AdvSmoothMessageDialog 1.4.1.2
I call the Execute() and two time CloseDialog().
On the second call I get access violation
The dialog is called from remote application and i don't know if is visible or not

We will need a sample project as we can not reproduce this after another test.

AdvSmoothMessageDialog1->Modal= false;
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AdvSmoothMessageDialog1->Execute();
}
void __fastcall TForm1::Button2Click(TObject *Sender)
{
AdvSmoothMessageDialog1->CloseDialog();
}

Moreover, the timeout only works the first time I call the execute(), the second does not go off.

Sorry i forgot
Click Button1, close the dialog from his button and then click Button2

Thank you, the problem was with the non modal dialogs.
We've solved the issue and the fix will be available in the next update of the TMS VCL UI Pack.

Another problem is that the maximumHeight and maximumWidth don't work.
Is there a way to prevent the spaces on the left from being truncated?
Thanks!

I cannot see a problem with maximumheight / maximumwidth.

In this example, the maximumwidth was set to 200, causing the dialog text to show wordwrapped to respect this maximum width:
image

I'm not sure what truncation you refer to.

the text is AdvSmoothMessageDialog1->HTMLText->Text="                first row of text\r\n              second\r\nterza\r\n";

I'm trying to investigate when the maximumWidth is not respected because it happens sometime

This is the code
if( AdvSmoothMessageDialog1->HTMLText->Text != "" )
   AdvSmoothMessageDialog1->CloseDialog();
AdvSmoothMessageDialog1->Caption= titolo;
AdvSmoothMessageDialog1->HTMLText->Text= "                               riga 1\r\n           SECONDA RIGA\r\n";
AdvSmoothMessageDialog1->ExecuteDialog();

Thanks!

With the information you provide (I have no info on your MaximumWidth setting or other settings) , I cannot reproduce the 2nd dialog screenshot here.

This is the DFM file in the first screen with the truncated text

  object AdvSmoothMessageDialog1: TAdvSmoothMessageDialog
    MaximumWidth = 400
    MaximumHeight = 200
    MinimumWidth = 400
    MinimumHeight = 200
    Modal = False
    ButtonAreaFill.Color = clWhite
    ButtonAreaFill.ColorTo = clWhite
    ButtonAreaFill.ColorMirror = clNone
    ButtonAreaFill.ColorMirrorTo = clNone
    ButtonAreaFill.GradientType = gtVertical
    ButtonAreaFill.GradientMirrorType = gtSolid
    ButtonAreaFill.Opacity = 0
    ButtonAreaFill.OpacityTo = 100
    ButtonAreaFill.BorderColor = clNone
    ButtonAreaFill.Rounding = 5
    ButtonAreaFill.RoundingType = rtBottom
    ButtonAreaFill.ShadowOffset = 0
    ButtonAreaFill.Glow = gmNone
    Buttons = <>
    CaptionFont.Charset = DEFAULT_CHARSET
    CaptionFont.Color = clBlack
    CaptionFont.Height = -11
    CaptionFont.Name = 'Tahoma'
    CaptionFont.Style = []
    ButtonFont.Charset = DEFAULT_CHARSET
    ButtonFont.Color = clWindowText
    ButtonFont.Height = -11
    ButtonFont.Name = 'Tahoma'
    ButtonFont.Style = []
    CaptionFill.Color = clWhite
    CaptionFill.ColorMirror = clNone
    CaptionFill.ColorMirrorTo = clNone
    CaptionFill.GradientType = gtVertical
    CaptionFill.GradientMirrorType = gtSolid
    CaptionFill.Opacity = 100
    CaptionFill.OpacityTo = 0
    CaptionFill.BorderColor = clNone
    CaptionFill.Rounding = 5
    CaptionFill.RoundingType = rtTop
    CaptionFill.ShadowOffset = 0
    CaptionFill.Glow = gmNone
    CaptionHeight = 40
    Fill.Color = clWhite
    Fill.ColorTo = clWhite
    Fill.ColorMirror = clNone
    Fill.ColorMirrorTo = clNone
    Fill.GradientType = gtVertical
    Fill.GradientMirrorType = gtSolid
    Fill.Opacity = 240
    Fill.OpacityTo = 220
    Fill.BorderColor = clBlack
    Fill.Rounding = 5
    Fill.ShadowOffset = 0
    Fill.Glow = gmNone
    HTMLText.Text = 
      '                          Hello world, this is my text to see if' +
      ' the maximum value are respected and if i write more the width i' +
      'ncrease'
    HTMLText.Font.Charset = DEFAULT_CHARSET
    HTMLText.Font.Color = 4474440
    HTMLText.Font.Height = -13
    HTMLText.Font.Name = 'Tahoma'
    HTMLText.Font.Style = [fsBold]
    Position = poMainFormCenter
    Version = '1.4.1.2'
    ProgressMaximum = 100.000000000000000000
    ProgressAppearance.BackGroundFill.Color = clWhite
    ProgressAppearance.BackGroundFill.ColorTo = clWhite
    ProgressAppearance.BackGroundFill.ColorMirror = clNone
    ProgressAppearance.BackGroundFill.ColorMirrorTo = clNone
    ProgressAppearance.BackGroundFill.GradientType = gtVertical
    ProgressAppearance.BackGroundFill.GradientMirrorType = gtSolid
    ProgressAppearance.BackGroundFill.BorderColor = 12895944
    ProgressAppearance.BackGroundFill.Rounding = 0
    ProgressAppearance.BackGroundFill.ShadowOffset = 0
    ProgressAppearance.BackGroundFill.Glow = gmNone
    ProgressAppearance.ProgressFill.Color = 14925219
    ProgressAppearance.ProgressFill.ColorTo = clNone
    ProgressAppearance.ProgressFill.ColorMirror = clNone
    ProgressAppearance.ProgressFill.ColorMirrorTo = clNone
    ProgressAppearance.ProgressFill.GradientType = gtVertical
    ProgressAppearance.ProgressFill.GradientMirrorType = gtNone
    ProgressAppearance.ProgressFill.BorderColor = 14925219
    ProgressAppearance.ProgressFill.Rounding = 0
    ProgressAppearance.ProgressFill.ShadowOffset = 0
    ProgressAppearance.ProgressFill.Glow = gmNone
    ProgressAppearance.Font.Charset = DEFAULT_CHARSET
    ProgressAppearance.Font.Color = clWindowText
    ProgressAppearance.Font.Height = -11
    ProgressAppearance.Font.Name = 'Tahoma'
    ProgressAppearance.Font.Style = []
    ProgressAppearance.ProgressFont.Charset = DEFAULT_CHARSET
    ProgressAppearance.ProgressFont.Color = clWindowText
    ProgressAppearance.ProgressFont.Height = -11
    ProgressAppearance.ProgressFont.Name = 'Tahoma'
    ProgressAppearance.ProgressFont.Style = []
    ProgressAppearance.ValueFormat = '%.0f%%'
    Left = 464
    Top = 180
    TMSStyle = 0
  end

this is the second dfm file

  object SMD_messaggio: TAdvSmoothMessageDialog
    MaximumWidth = 600
    MaximumHeight = 600
    MinimumWidth = 500
    MinimumHeight = 500
    Modal = False
    ButtonAreaFill.Color = clWhite
    ButtonAreaFill.ColorTo = clWhite
    ButtonAreaFill.ColorMirror = clNone
    ButtonAreaFill.ColorMirrorTo = clNone
    ButtonAreaFill.GradientType = gtVertical
    ButtonAreaFill.GradientMirrorType = gtSolid
    ButtonAreaFill.Opacity = 0
    ButtonAreaFill.OpacityTo = 100
    ButtonAreaFill.BorderColor = clNone
    ButtonAreaFill.Rounding = 5
    ButtonAreaFill.RoundingType = rtBottom
    ButtonAreaFill.ShadowOffset = 0
    ButtonAreaFill.Glow = gmNone
    Buttons = <>
    Caption = 'TITOLO'
    CaptionFont.Charset = DEFAULT_CHARSET
    CaptionFont.Color = clMaroon
    CaptionFont.Height = -35
    CaptionFont.Name = 'Tahoma'
    CaptionFont.Style = [fsBold]
    ButtonFont.Charset = DEFAULT_CHARSET
    ButtonFont.Color = clWindowText
    ButtonFont.Height = -11
    ButtonFont.Name = 'Tahoma'
    ButtonFont.Style = []
    CaptionFill.Color = 10066329
    CaptionFill.ColorMirror = clNone
    CaptionFill.ColorMirrorTo = clNone
    CaptionFill.GradientType = gtVertical
    CaptionFill.GradientMirrorType = gtSolid
    CaptionFill.Opacity = 240
    CaptionFill.OpacityTo = 0
    CaptionFill.BorderColor = clNone
    CaptionFill.Rounding = 5
    CaptionFill.RoundingType = rtTop
    CaptionFill.ShadowOffset = 0
    CaptionFill.Glow = gmNone
    CaptionHeight = 40
    Fill.ColorTo = clWhite
    Fill.ColorMirror = clNone
    Fill.ColorMirrorTo = clNone
    Fill.GradientType = gtVertical
    Fill.GradientMirrorType = gtSolid
    Fill.Opacity = 239
    Fill.OpacityTo = 239
    Fill.BorderColor = clNone
    Fill.Rounding = 5
    Fill.ShadowOffset = 0
    Fill.Glow = gmNone
    HTMLText.Text = 
      '        pippo lsdf asdf asf safd asd fs d fasd f asd fasdfasdf a' +
      'sdf  sadf asd f sadf as dfas dfgas dfasd fsa f as fas fas fasd f' +
      'asdd  fas f asd fas fas gfasd f lsdfjlaskfdjlaskfdjla'#242'skjsda'#242'lks' +
      'ajdf  lkasjdfl'#242'k kasdlfkj '#242'lkasdjf lskdjf'#242'lkajsd'#242'lfkjasl'#242'dkfj'#242'lk' +
      'jsad  f'#242'lkasjd'#242'lfkjas'#242'ldkfj'#242'lkajsd'#242'lfkj'#242'lkasjdf'#242'lkjas'#242'ldfkjwoieu' +
      'rp owi erpoiqwue rpoiwuer poqiwuer oqwieur poqiweur  poqiweurpoi' +
      'q wuerpoiqwuer poiqweur poiwuer oqiweu  rpoqiwuer opqiweur poiqw' +
      'uer opqiewur poqiwer'
    HTMLText.ShadowOffset = 2
    HTMLText.Font.Charset = DEFAULT_CHARSET
    HTMLText.Font.Color = clBlack
    HTMLText.Font.Height = -27
    HTMLText.Font.Name = 'Tahoma'
    HTMLText.Font.Style = [fsBold]
    Position = poOwnerFormCenter
    Version = '1.4.1.2'
    ProgressMaximum = 100.000000000000000000
    ProgressAppearance.BackGroundFill.Color = clWhite
    ProgressAppearance.BackGroundFill.ColorTo = clWhite
    ProgressAppearance.BackGroundFill.ColorMirror = clNone
    ProgressAppearance.BackGroundFill.ColorMirrorTo = clNone
    ProgressAppearance.BackGroundFill.GradientType = gtVertical
    ProgressAppearance.BackGroundFill.GradientMirrorType = gtSolid
    ProgressAppearance.BackGroundFill.BorderColor = 12895944
    ProgressAppearance.BackGroundFill.Rounding = 0
    ProgressAppearance.BackGroundFill.ShadowOffset = 0
    ProgressAppearance.BackGroundFill.Glow = gmNone
    ProgressAppearance.ProgressFill.Color = 14925219
    ProgressAppearance.ProgressFill.ColorTo = clNone
    ProgressAppearance.ProgressFill.ColorMirror = clNone
    ProgressAppearance.ProgressFill.ColorMirrorTo = clNone
    ProgressAppearance.ProgressFill.GradientType = gtVertical
    ProgressAppearance.ProgressFill.GradientMirrorType = gtNone
    ProgressAppearance.ProgressFill.BorderColor = 14925219
    ProgressAppearance.ProgressFill.Rounding = 0
    ProgressAppearance.ProgressFill.ShadowOffset = 0
    ProgressAppearance.ProgressFill.Glow = gmNone
    ProgressAppearance.Font.Charset = DEFAULT_CHARSET
    ProgressAppearance.Font.Color = clWindowText
    ProgressAppearance.Font.Height = -11
    ProgressAppearance.Font.Name = 'Tahoma'
    ProgressAppearance.Font.Style = []
    ProgressAppearance.ProgressFont.Charset = DEFAULT_CHARSET
    ProgressAppearance.ProgressFont.Color = clWindowText
    ProgressAppearance.ProgressFont.Height = -11
    ProgressAppearance.ProgressFont.Name = 'Tahoma'
    ProgressAppearance.ProgressFont.Style = []
    ProgressAppearance.ValueFormat = '%.0f%%'
    OnClose = SMD_messaggioClose
    Left = 960
    Top = 194
    TMSStyle = 0
  end

The problem here is that there are already non-breakable words exceeding the maximum width specified. We applied an improvement to deal with it but due to this, the non-breakable word cannot be displayed fully.

The problem remains that in the second image the spaces at the beginning of the first line are truncated and the text cut

In HTML, spaces are treated this way. If you do not want this, use   instead of space characters.