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
Antwort Antwort
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
Benutzerbild von chaosben
chaosben

Registriert seit: 27. Apr 2005
Ort: Görlitz
1.358 Beiträge
 
Delphi XE2 Professional
 
#2

Re: from TListView to VirtualStringTree

  Alt 13. Jul 2009, 17:44
What do you mean with
Zitat von mohfa:
that doesn't give the same result .
?
Benjamin Schwarze
If I have seen further it is by standing on the shoulders of Giants. (Isaac Newton)
  Mit Zitat antworten Zitat
mohfa

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

Re: from TListView to VirtualStringTree

  Alt 13. Jul 2009, 18:02
thank you chaosben

i meant the result is not the same as with the TListView .

the code does a TListView auto-scroll from a Second Form where i have 2 buttons ( UP_Scroll and DOWN_Scroll ) of course via the Msg .

the code works good with the TListView and i can see the UP_scroll and DOWN_scroll with IT . but with TVirtualStringTree

if you want i can attache a little sample of IT ?
  Mit Zitat antworten Zitat
generic

Registriert seit: 24. Mär 2004
Ort: bei Hannover
2.415 Beiträge
 
Delphi XE5 Professional
 
#4

Re: from TListView to VirtualStringTree

  Alt 13. Jul 2009, 18:46
tell me what your function should do, please.

i'm sure there is a much simpler way in vst style.
Coding BOTT - Video Tutorials rund um das Programmieren - https://www.youtube.com/@codingbott
  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 08:50 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