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 TStringGrid Textüberlappend (https://www.delphipraxis.net/11269-tstringgrid-textueberlappend.html)

Robert_G 3. Nov 2003 11:16


TStringGrid Textüberlappend
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hi,
Ich möchte in einem StrinGrid die Einträge einer Tabelle darstellen, die einer Validierungs-rule nicht entsprechen.
Für normale Werte (Seitennummer,Patienten-ID,...) ist das kein Problem.
Ich hätte aber ganz gerne jeweils unter diesen Werten die message der rule stehen ohne das sie abgeschnitten wird.
(siehe Anhang)
Hat irgendjemand eine Idee?

Robert_G 3. Nov 2003 11:18

Re: TStringGrid Textüberlappend
 
Hab vergessen es als "offene Frage" abzusenden

Robert_G 3. Nov 2003 12:35

Re: TStringGrid Textüberlappend
 
Also das ist ein Standard Output meiner ORACLE - Testmode procedur:

Rule message : ["'||codelist_value(cts$panel,'LBSEQ',this.lbseq)|| '" ('||this.LBORRES||' '||Plaus_REC.CRFUNIT||') is outside plausibility range '||RANGE_CHR||' and clinically acceptable.]
Panel name: CHEM - Rule name: OOR_LBORRES_CA
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::: :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::Start: 03.11.2003 - 13:26:11
RECno. Pageid Pagerpid Subjid Blid lborres_repl low high unit factor Calc res.
__________________________________________________ _________ __________________________________________________ __________________
15 0110 1001 0020 2338 0 1000 U/L 1 2338
Message:
"SGOT/AST" (2338 U/L) is outside plausibility range (0 - 1000 U/L) and clinically acceptable.
------------------------------------------------------------ -------------------------------------------------------------------- 16 0110 1001 0020 2229 0 1000 U/L 1 2229
Message:
"SGPT/ALT" (2229 U/L) is outside plausibility range (0 - 1000 U/L) and clinically acceptable.
------------------------------------------------------------- ------------------------------------------------------------------- 96 0180 1002 0080 1156 0 1000 U/L 1 1156
Message:
"SGPT/ALT" (1156 U/L) is outside plausibility range (0 - 1000 U/L) and clinically acceptable.
------------------------------------------------------------- ------------------------------------------------------------------- 222 0140 1005 0060 0.3 30 250 umol/L 88.4 26.52
Message:
"Serum Creatinine" (0,3 mg/dL) is outside plausibility range (0.34 - 2.83 mg/dL) and clinically acceptable.
------------------------------------------------------------- -------------------------------------------------------------------__________________________________________________ ____________ __________________________________________________ _______________
Records: 300 Count of False: 4
End: 03.11.2003 - 13:26:18 Duration: 7 Sec



In diesem Fall waren die Werte nicht breiter als ein Tab und stehen schön untereinander.
Meistens jedoch kann man nur durch Tab-Zählen auf die Spalte schließen.
Deshalb wollte ich das ganze tab-getrennt in ein Grid bringen. :roll:
Problem - die message wird jetzt abgeschnitten weil sie nicht breiter als die Spalte sein kann. :wiejetzt:

Also ich hoffe das Problem ist nicht zu banal - ich arbeite erst seit kurzem mit Delphi und bin für jeden Tip dankbar...

[edit=Daniel B]Zeilen umgebrochen. Mfg, Daniel B[/edit]

Robert_G 4. Nov 2003 14:49

Re: TStringGrid Textüberlappend
 
Ich hab´s doch noch raus gefunden.



Mit dem dem Code kann man eine Zelle auf die gesamte Breite des Grids erweitern.
(ähnlich wie "merge cells" in Excel)

Delphi-Quellcode:
procedure TRule_Form.OutGridDrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
   i,y,x:integer;
begin

  If aCol = 0 Then Exit;
  If gdFixed In State Then Exit;
  If OutGrid.Cells[0,arow] <> 'Message' Then exit;
  with sender as tstringgrid do begin

  // Komplette Zeile mit dem Text von Spalte 1 füllen
    If aCol < Pred(ColCount) Then
      Rect.Right := Rect.Right + GridlineWidth;

    y:= Rect.Top + 2;
    x:= Rect.Left + 2;
    for i:= 1 to aCol-1 do
      x:= x - ColWidths[i] - GridlineWidth;

    { Paint Zellenhintergrund weiß}
    Canvas.Brush.Color := $FFFFFF;
    Canvas.Brush.Style := bsSolid;
    Canvas.FillRect( Rect );

    Canvas.TextRect( Rect, x, y, Cells[1,arow] );
  end;

end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:10 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