AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

from TListView to VirtualStringTree

Ein Thema von mohfa · begonnen am 13. Jul 2009 · letzter Beitrag vom 13. Jul 2009
 
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

from TListView to VirtualStringTree

  Alt 13. Jul 2009, 16:10
hi i use the following Code with the TListView :
Delphi-Quellcode:
// LV := TListView
procedure TForm1.umQUARPROPMSG(var Msg: TMessage);
var
  Item : TListItem;
  i : integer;
  res : boolean;
  info : TMyInfo;
begin
  Msg.Result := 1;
  res := Msg.LParam = 0;

 
    Item := lv.Selected;

    if Item <> nil then begin
      i := Item.Index;
      if Msg.LParam <> 0 then
        Inc(i, Msg.LParam)
      else
        Inc(i, Msg.WParam);

      if (i < 0) or (i >= lv.Items.Count) then
        Msg.Result := 0
      else begin
        Item := lv.Items[i];

        lv.Selected := Item;
        Item.MakeVisible(false);
        Item.Focused := true;
        Update;

        if res then begin
          info := TMyInfo(Item.Data);
          with FMyInfo as TMyIndo do begin

            info.GetInfoText(Memo1.Lines, Memo1.ClientWidth -8, Memo1.Font);

            Memo1.SelStart := 0;
            Memo1.SelLength := 0;
          end;
        end;
      end;

    

  end;
end;
But when i apply it with the TVirtualStringTree like this :
Delphi-Quellcode:
//Vst:=TVirtualStringTree
procedure TForm1.umQUARPROPMSG_(var Msg: TMessage);
var
 // Item : TListItem;

  Node: PVirtualNode;
  Data: PTreeData;
  i : integer;
  res : boolean;
  info : TMyInfo;
begin
  Msg.Result := 1;
  res := Msg.LParam = 0;

  // Item := lv.Selected;
     Node:=VST.FocusedNode;
    Data:=VST.GetNodeData(Node);

    if Node <> nil then begin
    i:=node.Index;

     // i := Item.Index;
      if Msg.LParam <> 0 then
        Inc(i, Msg.LParam)
      else
        Inc(i, Msg.WParam);

      if (i < 0) or (i >=vst.TotalCount)then
        Msg.Result := 0
      else begin

       // Item := lv.Items[i];
       vst.FocusedNode:=node;

       vst.Focused;

      // lv.Selected := Item;
      // Item.MakeVisible(false);
      // Item.Focused := true;
        Update;

        if res then begin
          info := TMyInfo(data);
          with FMyInfo as TMyInfo do begin

            info.GetInfoText(Memo1.Lines, Memo1.ClientWidth -8, Memo1.Font);
            Memo1.SelStart := 0;
            Memo1.SelLength := 0;
          end;
        end;
      end;

  

  end;
end;
that doesn't give the same result .
Is there any error with Code used in VST ?
  Mit Zitat antworten Zitat
 


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 08:46 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz