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

Re: TVirtualDrawtree

Mesaj gönderen mia »

ok i got an equation here is what i done

i removed

Kod: Tümünü seç

  xSelItemLeft   : Integer = 0;
  xSelItemWidth  : Integer = 0;
  xSelItemHeight : Integer = 0;
and keep only

Kod: Tümünü seç

xSelItemTop    : Integer = 0; // to align the top of panel to the item 


also i did not set xSelItemTop variable if item.selected but instead i start set variable any ways if its selected or not like this

Kod: Tümünü seç

if Item.Selected then
    begin
      SetRect(R, Rect.Left, Rect.Top, Rect.Right, Rect.Bottom-( (Rect.Bottom-Rect.Top) div 2 ) );
      GradientFillCanvas(Sender.Canvas, SlightlyDark(panel1.Color), SlightlyDark(panel1.Color), R, gdhorizontal); // GraphUtil
      SetRect(R, Rect.Left, Rect.Bottom-( (Rect.Bottom-Rect.Top) div 2 ), Rect.Right, Rect.Bottom );
      GradientFillCanvas(Sender.Canvas, SlightlyDark(panel1.Color), SlightlyDark(panel1.Color), R, gdhorizontal);
      Sender.Canvas.Brush.Style := bsClear;
      Sender.Canvas.Pen.Color   := SlightlyDark(panel1.Color);
      Sender.Canvas.Pen.Width   := 0;

      //Sender.Canvas.Font.Color  := clBlue;
      //Sender.Canvas.Brush.Color := clYellow;
      //Sender.Canvas.FillRect(Rect);
      Rectangle( Rect.Left, Rect.Top,  Rect.Right, Rect.Top + ImageList1.Height);
    end;
    xSelItemTop    := sender.Top + ImageList1.Height;
    Sender.Canvas.Brush.Style := bsClear
i dont know if this are very messy steps , here is the project to help others , and if i have horrible mistake correct me
Dosya ekleri
newclienta.rar
(93.76 KiB) 85 kere indirildi
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

if this code serves you, that's ok. No worry about it :)
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

no series unsafe issues ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

I gave example for dynamic Item Rect Top issues...

Now this procedure not needs Item's top value... This is static and equals to

Kod: Tümünü seç

Panel2.Top := ListView1.Top + ImageList1.Height
Just define this once, then only Visible True or False state will work for you.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

i have also wana thank you about fixing the server side command but i have some nagging question , i been using my server before to define some connection in some channel and send data to spicif channel as example like this

Kod: Tümünü seç

procedure TServobj.BroadCastFREEALL(const FREEALL: String; const FromUniqueID: DWord;
  const FromFREEALL: string);
var
  Index: Integer;
  Index_channel: Integer;
  Connection: TConnection;
begin
  for Index_channel:= 0 to Connections.Count -1 do
  begin
    if TConnection(Connections.Items[Index_channel]).UniqueID = FromUniqueID then
    begin
      Break;
    end;
  end;
  for Index := 0 to Connections.Count - 1 do
  begin
    Connection := Connections.Items[Index];
    if (Connection.UniqueID <> FromUniqueID) and (Connection.CURROOM = TConnection(Connections[Index_channel]).CURROOM) then
      SendCommandWithParams(Connection, 'FREEMIC', FromFREEALL + Sep + FREEALL + Sep);
  end;

end;
i was define the transaction goes to who in server side it is better to define in client side ? as your example

Kod: Tümünü seç

strUniqueID <> IntToStr(UniqueID) then 
why you checked on client side instead for checking on server side ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 for broadcasting or check the message state (a future you will need i guess) issues.

In the case of "user status change", your status will be changed (for example idle to busy). Locally you may know last state but with addendum, doublecheck the state with server side. You will know that the server send this actual state to the all connected users. Also you...

In client project, the state change is not by local, triggered by remote response you see. If your state changed successfully, all users got the same actual state you will know.

if server or a client wants to broadcast a message to the all users, this will be without any user exception even client itself.

One more client not change anything in the traffic, but less one may be get malfunction.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

you are great man abi :D your mind is from another world i have never meet guy knowledgeable like you i will continue work inside my project and will come back to if pitfalls happend, i hope that iam not nagging you mrmarman .
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

nice words, thanks. :)
you're welcome...
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

hello again mrmarman i know i have a ton of question :D , is it possible if i click on startstream i hide my status icon and show a panel instead and if i click on stopstream i show my status icon again ? as example this image

Resim
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 just a basic if question.

Kod: Tümünü seç

    // User State Image
      if (Item.SubItems[5] <> '-') AND (NOT Panel2.Visible)  then
      begin
        ImageList1.Draw( Sender.Canvas, Rect.Left, Rect.Top, StrToInt(Item.SubItems[5]) );
      end;

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

Re: TVirtualDrawtree

Mesaj gönderen mia »

omg that easy :(( iam stupid thank you mrmarmaaaaaaaaaannnnnnnnnnnnnn
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

@mrmarman yazdı:- The object programming like Chain Reaction Toys you know. Don't forget it...
Please use all instruments which can you hold your hands.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

yes you are right iam too much rush , i found pitfall when using this , its hide all status of other clients as well if i want to hide to my self let me gues i have to creat a variable for me to check if iam streaming ? or there is better idea
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

You can rebuild the IF block to serve yourself...

Kod: Tümünü seç

    // User State Image
      if (Item.SubItems[5] <> '-')  then
      begin
        if Panel2.Visible AND (Item.Index = 0) 
        then true // do nothing
        else ImageList1.Draw( Sender.Canvas, Rect.Left, Rect.Top, StrToInt(Item.SubItems[5]) );
      end;
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

hello mrmarman , i have question about broadcast to multiable channel , what is the right way to do ?

i basically can add to the tconnection a new variable like this

Kod: Tümünü seç

  TConnection = class(TObject)
    Name: String;
    IP: String;
    Connected: TDateTime;
    UniqueID: DWORD;
   Channel : integer; // here is  the channel 
    Thread: Pointer;
  end;
what is the right and secure way to use my protocl to send any broadcast data where user in channel as example 1

i used before getter and setter to set channel for users i know that part , but i just wana verify a secure way with the protocol that you fixed to me like get client list for current channel number only
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
in god i trust with every movement i do
graduated student and looking for knowledge
Cevapla