Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Zeilenumbruch bei JvDesktopAlert von JVCL (https://www.delphipraxis.net/190400-zeilenumbruch-bei-jvdesktopalert-von-jvcl.html)

jus 30. Sep 2016 00:11


Zeilenumbruch bei JvDesktopAlert von JVCL
 
Hallo,

ich würde gerne in dem MessgeText von der JVCL Komponente JvDesktopAlert einen Zeilenumbruch machen. Weiß jemand wir man bei der Komponente sowas macht?

Ich mit folgendes vergeblich probiert:
Delphi-Quellcode:
JvDesktopAlert1.MessageText:='Name'+ #13#10 +'Strasse';
Es scheint so zu sein, dass JvDesktopAlert1.MessageText auf TJvLabel basiert. Leider weiß ich nicht, wie man da einen Zeilenumbruch macht. :(

lg,
jus

jus 30. Sep 2016 01:31

AW: Zeilenumbruch bei JvDesktopAlert von JVCL
 
ok, ich denke, dass ich eine Lösung für mich selber gefunden habe. Die Lösung ist zwar ein bisschen "quick&dirty", aber für meinen Zweck reicht es. Und zwar habe ich in der JvDesktopAlertForm.pas brutal die Labelhöhe geändert.
Delphi-Quellcode:
unit JvDesktopAlertForm;

...

//=== { TJvFormDesktopAlert } ================================================

constructor TJvFormDesktopAlert.Create(AOwner: TComponent);
begin
  inherited CreateNew(AOwner, 1);

  Font.Assign(Screen.IconFont);
  MouseTimer := TTimer.Create(Self);
  MouseTimer.Enabled := False;
  MouseTimer.Interval := 200;
  MouseTimer.OnTimer := DoMouseTimer;
  MouseTimer.Enabled := True;

  BorderStyle := bsNone;
  BorderIcons := [];
  Scaled := False;
  Height := cDefaultAlertFormHeight;
  Width := cDefaultAlertFormWidth;
  OnPaint := FormPaint;

  imIcon := TImage.Create(Self);
  imIcon.Parent := Self;
  imIcon.SetBounds(8, 11, 32, 32);
  imIcon.AutoSize := True;
  imIcon.Transparent := True;

  lblHeader := TLabel.Create(Self);
  lblHeader.Parent := Self;
  lblHeader.SetBounds(48, 11, 71, 13);
  lblHeader.Font.Style := [fsBold];
  lblHeader.Transparent := True;

  lblText := TJvLabel.Create(Self);
  lblText.Parent := Self;
  lblText.AutoSize := False;
  //lblText.SetBounds(56, 24, 67, 13); // Original
  lblText.SetBounds(56, 24, 67, 50); //<----hier geändert
  lblText.Transparent := True;
  lblText.WordWrap := True;
  lblText.Anchors := [akLeft..akBottom];

...

end;
Danach wird der Text umgebrochen.

lg,
jus

nahpets 30. Sep 2016 10:01

AW: Zeilenumbruch bei JvDesktopAlert von JVCL
 
Versuch es doch mal mit
Delphi-Quellcode:
lblText.AutoSize := True;
. Eigentlich sollte sich das Label dann dem Inhalt anpassen.
Was ich nicht weiß ist, ob der übrige Teil von JvDesktopAlert damit umgehen kann und die Optik mit der Änderung "manierlich" bleibt.


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:04 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz