TVirtualDrawtree

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

TVirtualDrawtree

Mesaj gönderen mia »

iam trying to use component from

Kod: Tümünü seç

 http://www.soft-gems.net/index.php/controls/virtual-treeview
because i see some delphi project using it as listbox

how could i do the same listbox i used Spy & capture to detect the control name any one know how to do that same of this listbox ? its supporting animated gifs and blink names but i cannot see this property in the component also for gradient background also i dont know how to add items inside it
En son mia tarafından 07 May 2015 04:11 tarihinde düzenlendi, toplamda 1 kere düzenlendi.
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TVirtualDrawtree

Mesaj gönderen mrmarman »

Hi.
In this forum who knows me, I do not use any 3rd party component unless it is necessary. :roll:
I say always "magic in your brain, illusion is everywhere." also this is in my forum signature you see.

So, now I show you a magic trick.
All I used VCL below is Delphi's native components.
But first you must try. It's your turn to research. :D

Later I will share you the whole code ... :idea:
The image below you will see
(1) a standart Delphi native TListView,
(2) with an TOpenDialog, you choose an image file and put this file a temprorary TImage component.
(3) every TListView Item has one of SubItem which contains GIF or BMP or ext. image as a TObject
(4) a TTimer which Repaint the TListView every interval.
(5) TListView has OwnerDraw property enabled, so you must Draw the Image to the Canvas, and write text with TextOut over the TListView Canvas. You must do it in the TListView's OnDrawItem event.
(6) an empty TImageList will help you to enlarge the TListView Item Height.

thats it... have fun. :wink:

Resim
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

OMGGGGG how you do that what a brain guy you are
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

still one thing list view not support html i cannot also add gradient background support html , also i try to animate the gif but i fail :d , but you did omg thats genius
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TVirtualDrawtree

Mesaj gönderen mrmarman »

please try, i gave the all glues with know-how.

There is no html. Only coordinated canvas operations.
First try to draw an image to the listview canvas please. Othet things automatically will follow.
Resim
Resim ....Resim
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TVirtualDrawtree

Mesaj gönderen mrmarman »

I'm still waiting some code...

Resim
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

iam trying all ways to do same you did i fail its 4 hours right now , iam fail in this test
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

i even try to use google and stack
http://stackoverflow.com/questions/6612 ... omdrawitem

no example as you did
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

omg how you did all of this :(
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TVirtualDrawtree

Mesaj gönderen mrmarman »

This is a clue to show how it is easy to start. :idea:

Kod: Tümünü seç

Uses GifImg;

Var
  xGif : TGIFImage;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  ListView1.OwnerDraw := True;
  if xGif = nil then
  begin
    xGif := TGIFImage.Create;
    xGif.LoadFromFile( 'animation.gif' );
    xGif.Animate := True;
  end;
  Caption := 'Animation Disabled';
  Timer1.Interval := 200;
  Timer1.Enabled  := NOT Timer1.Enabled;
end;

procedure TForm1.ListView1CustomDraw(Sender: TCustomListView;
  const ARect: TRect; var DefaultDraw: Boolean);
begin
  if xGif <> Nil
    then Sender.Canvas.Draw( 10, 50, xGif );
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  if TTimer(Sender).Enabled
    then Caption := 'Animation Enabled';
  ListView1.Repaint;
end;
Dosya ekleri
AnimatedListView_Sample.rar
Sample Project and Source
(225.93 KiB) 168 kere indirildi
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

i see the example its adds images in folder , but the image up there shows image from url , this huge work to get understand , i think it was hardest that i thought
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TVirtualDrawtree

Mesaj gönderen mrmarman »

url image is also similar, but a little bit far. You need to download it to the a temporary folder first. Then it is same as example.

I gues you want to use a vcl. All vcl's start from like this example you know. You write a helper unit first, then build a new component over it.

Nothing easy in life. You make it easier with research. We say this experience you know.
If you say, this is hard way I want it easier one, then I say you have to buy license for that vcl which you like .
I'm not rich enough for that. :)

I don't say to explore America again, but i know you can make it with some practice on canvas operations.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

is this images can be click able on list view like on click on this animated images on list view show up a form ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Kullanıcı avatarı
mrmarman
Üye
Mesajlar: 4741
Kayıt: 09 Ara 2003 08:13
Konum: İstanbul
İletişim:

Re: TVirtualDrawtree

Mesaj gönderen mrmarman »

yes but depending your design. listview's Click event will inform you, where the user click on.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

thats how i get animation from url what i try so far i saved it to memory stream , but gif is too slow also i can i make diffrent image for each item ? and how to specif items with images ?
Dosya ekleri
AnimatedList.zip
(26.49 KiB) 109 kere indirildi
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Cevapla