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 »

yes i found the clue it was on tagme button , the way you did is very close to that way i need but problems always stopped my mind

here is how you store the images

Kod: Tümünü seç

procedure Ttestthreading.Button1Click(Sender: TObject);
begin
  if ListView1.Selected = Nil then
  begin
    MessageDlg('You must select a user first...', mtWarning, [mbOk], 0 );
    Exit;
  end;
  // 0 Standard - 1 Idle - 2 Busy - 3 Writing - d Out for lunch
  ListView1.Selected.SubItems[5] := IntToStr( ComboBox1.ItemIndex ); // StateIndex
end;
but let me define the logic because i maybe didnt define the problem very well

lets say there is 2 or 3 or 100 users lets assume that there is 2 users now Mrmarman and mia

so mia decided to go busy by clicking in some popup menu busy not on clicking on selected mrmarman user to set his status to him self and also by sending command to server to show her status to other connected users idea of view same as skype if i click away my friend see that iam away if i clicked online my friends see that iam online , i just want to know the right way to do that
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 explained before but I couldn't success. You must broadcast all users status changes to the server, and then server to the all connected users with nessage.

If mrmarman changes his status to the busy, client project must send this change to the server immediately.
The server side, (like login transaction) immediately send this message to the all clients.

All clients change the status of sender user with their listview same as click the tagme button mimic.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

thats exactly what i try to implement is that easy to implement with my client and server ? can i see pretty example of that
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 it is easy as i said.

I gave you an example other message thread, remember that; signup-register user, online, offline event changes ext. i gave you before. Please look that example again, you will find it. ...

I'm now İstanbul and very very busy for Dardanelle War 100th year of meetings.
If i find some free tine off course i will write you.
All of future things about your project, the protocol that you design. All this events talking over process procedure which you did. Please let you think about protocol by yourself. Remember that, the protocol thing for computet to computer talking about transaction issues. Not users.
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 »

Hi. This is example that I say..

In this example, your work almost finish. :roll:
From this point, just design your transaction protocol and go.

You may delete the Memo1 line addendums. You not be afraid to use memo1, use it for test the protocol. You must know what is going on machine side.

Resim
Dosya ekleri
clientserver.rar
project source
(101.34 KiB) 91 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 »

thank you mrmarmannnnnnnnnnn its working good but why its not saved the user statues when new client join ?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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 »

Let's say, I give you an oppotunity to do by yourself. :lol:
You need to solve this problem by yourself because you are the boss of yourself. :wink:
If I do all project for you, this means you cheat on yourself. Don't you ??...

This is too many way to do a lot of things.
But you're lucky, because you have all stream / text transaction instruments. Just you need to use it and improve the protocol.

(1) The both server and client sides, I fixed too many code. Firstly you need to cover them in your mind.
(2) When a user connected or disconnected, I put the SendClientsList procedure after transaction to renew the client lists you will see if you look that. You need to focus on that to your question. Client side, firstly the ListView Items cleared you see. This is why the user(s) state lost. Make a trick shot to save them. For example you may ping and refresh all user for last state like userlist thing or you also save the states on server's listview and refresh from that listview ext ext too many ways to do this easily.
(I also fixed send message to the user spesific. If UniqueID parameter equals (0) then the message will boradcast all users.)
--- after all working ---
(3) For images, you need a cache or temp folder to save images every client. Why? Because all the images saved to this folder to reduce the network traffic by image send/receive..
(4) If source image not exists or date-time information changed by local temp one, after then you download the image for user. This will speedup transaction.
(5) All images also must be on the server side.
(6) in my opinion all user must be sign up. Then you will make a database for this. I gave you example before. You must embed that technique to your project.
(7) After this database creation, you will also have a oppotunity to send offline messages if you want.

You have too many way and much work to finish this project you see. :wink: You must work work work very much... 8)
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 correct mrmarman i thanks you to brought me to that line of learning i will try to work over and do some tricks i always welling to fail to learn harder thank you very much .
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ
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're welcome. :bravo:
I want your good news about the project.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

thats what i did so far tell me if this method safe or its horrible

i remove the if statement of unique id check to get list for every body even to my self

i added global variable called status and sended the comand of change statuse when i new client requested GeTlist

here is the full project
Dosya ekleri
newclienta.zip
(196.22 KiB) 71 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 »

Hi.

- (1); When you define a global variable you may put default value to that. This is a safe technique..

Kod: Tümünü seç

Var // This is global section, local var section this statement will give you an error...
  Status : String = '-'; // default value
- (2); You might embed the actual status to the user list by adding only one more parameter. That might be more accurately... I wanted to see this action from you... :wink:

one last word, now you must draw a flow chart on a plain paper that what you want, and what the computer must do for your requirement(s). Make plan to improve the protocl according to this schematic.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

added default global variable , added new parameter called current status here is the full project
Dosya ekleri
newclienta.zip
(196.16 KiB) 55 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 »

You don't need to send whole project over again.
Are you satisfy the result, the important thing is just that.
Resim
Resim ....Resim
Kullanıcı avatarı
mia
Üye
Mesajlar: 239
Kayıt: 17 Nis 2015 02:18

Re: TVirtualDrawtree

Mesaj gönderen mia »

result is working pretty fine , but still some visual staff are not clear , my project will have stream button to allow send some audio if you remember the image that i send the user name has bring to top and there is a line has been added under his name can i do that with this listview ? 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 »

You make this with illusion.
You put an invisible button to the form. When click an item on listview, you move the button near that item and make became visible. Then use it what you want.

EDIT : for moving items look at this url...
Resim
Resim ....Resim
Cevapla