AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi GetDisplayRect return 0 (left,right,top,bottom)
Thema durchsuchen
Ansicht
Themen-Optionen

GetDisplayRect return 0 (left,right,top,bottom)

Ein Thema von jfarissi · begonnen am 28. Apr 2011 · letzter Beitrag vom 28. Apr 2011
Antwort Antwort
jfarissi

Registriert seit: 11. Apr 2011
3 Beiträge
 
#1

GetDisplayRect return 0 (left,right,top,bottom)

  Alt 28. Apr 2011, 09:25
Hello,

GetDisplayRect return 0 (left,right,top,bottom)

I can't show the button in the VST !?
any idea ?



Delphi-Quellcode:
  TNodeData1 = class
  public
    Column0: String;
    Column1: String;
    Column2: String;
    Column3: String;
    Column4: String;
    Column5: String;
    Column6: TButton;

  end;


procedure TFormb.DoResize(node: pvirtualnode);
var
  CellRect: trect;
  d: TNodeData1;
begin
  d:=TNodeData1(VirtualStringTree1.GetNodeData(node)^);
  CellRect := VirtualStringTree1.GetDisplayRect(node, 6, false);
  with d.Column6 do
  begin
    Left := CellRect.Left;
    Width := CellRect.Right-CellRect.Left;
    Top := CellRect.Top;
    Height := CellRect.Bottom-CellRect.Top;
  end;
end;




Procedure TFormb.SPMEditQueryGrid(DBName, Statement: String; Target:TVirtualStringTree; Titles: Boolean);
Var Col,i,j, Lin, nCol: Integer;
    d: TNodeData1;
begin

      With TQuery.Create(Nil) Do
      Try
        DatabaseName := DBName;
        SQL.Text := Statement;
        Open;
        If Not IsEmpty Then
        Begin
          //For Col := 0 To FieldCount - 1 Do
          // Target.Header.Columns[col].Text := Fields[Col].FieldName;
          While Not Eof Do
          Begin
            d:=TNodeData1.Create;
            d.Column1 := Fieldbyname('id_employe').AsString;
            d.Column2 := Fieldbyname('Collaborateur').AsString;
            d.Column3 := Fieldbyname('INTITULE_SERVICE').AsString;
            d.Column4 := formatfloat('0.00',Fieldbyname('NOMBRE_JOURS').Asfloat);
            d.Column5 := formatfloat('0.00',Fieldbyname('Montant').Asfloat);
            edtXnode := Target.AddChild(Target.FocusedNode,d);
            d.Column6 := TButton.Create(self);
            with d.Column6 do
            begin
              inc(incnamebutton);
              name := 'tata'+inttostr(incnamebutton)+Fieldbyname('id_employe').AsString;
              Parent := VirtualStringTree1;
              OnClick := ButtonClick;
              Target.inValidateNode(edtXnode);
              DoResize(edtXnode);
            end;

            Next;
          End;
        End;
      Finally
        Close;
        Free;
      End;
end; { QueryGrid }

Thanks

Geändert von Luckie (28. Apr 2011 um 09:34 Uhr) Grund: Delphi Tags ergänzt
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.542 Beiträge
 
Delphi 11 Alexandria
 
#2

AW: GetDisplayRect return 0 (left,right,top,bottom)

  Alt 28. Apr 2011, 09:38
Zitat:
TBaseVirtualTree.GetDisplayRect Method
Returns the visible region used by the given node in client coordinates.
Pascal
function GetDisplayRect(Node: PVirtualNode; Column: TColumnIndex; TextOnly: Boolean; Unclipped:
Boolean = False): TRect;
Description
If the given node cannot be found (because one of its parents is collapsed or it is invisible) then an empty rectangle is
returned. If TextOnly is true then only the text bounds are returned, that is, the resulting rectangle's left and right
border are updated according to the bidi mode, alignment and text width of the node. If Unclipped is true (which only
makes sense if also TextOnly is true) then the calculated text rectangle is not clipped if the text does not entirely fit into
the text space. This is special handling needed for hints.
If Column is NoColumn( see NoColumn Constant, page 686) then the entire client width is used before determining the
node's width otherwise the bounds of the particular column are used.
Notes
Column must be a valid column and is used independent of whether the header is visible or not.
Taken from here, hope it helps.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
jfarissi

Registriert seit: 11. Apr 2011
3 Beiträge
 
#3

AW: GetDisplayRect return 0 (left,right,top,bottom)

  Alt 28. Apr 2011, 12:16
thanks that work
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:28 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