_uc_funcs.pas

unit _uc_funcs;


interface

   uses classes,Windows,SysUtils,Graphics,ComCtrls,forms,FileCtrl,stdctrls,
        menus,Controls,dialogs,ShellApi,_uf_xoc_model,_uf_web_model;

procedure __DoDebugLOG(s:string);
procedure CreateComsOwnWebTab(nama,urla,chata:string);
procedure GoWebsAssingBLANKPAGES;
//procedure GoFreeComsOwnDynamicTabs;
procedure GoFreeWebTabOfCommunity(scm:string);
function CreateCom_XOC_Tab(nama:string; NodeOfCOM:TTreeNode):T_FrameXOC;
procedure GoFreeComs_Xoc_Tabs;
procedure GoFreeXocTabOfCommunity(scc:string);
function GetCategNAME(i:Byte):String;
function is_ip_tzz(x:string):byte;
procedure InitialiseLocals;
function GetLocalPcID: string;
procedure LoadGuiNodes;
function is_COMMUNITY_in_HOME(comADR: string): TTreeNode;
function is_user_in_this_ComNode(id: string;comNody:TTreeNode): TTreeNode;
function _is_UserID_in_The_NETWORKS_Tree(id: string): TTreeNode;
function _octos(n:int64):string;
function _percenty(red,saz: Int64): Int64;
function _percentyV2(red,saz: Int64): String;
function _folder_lastName(s:string):string;
function _GimeFavUserXtraFolder(id:string):string;
procedure _pp_xpoz_menu_on(sNode:TTreeNode);
procedure _put_DW_vItem(_cap,_nik,_ip,_id,_fullPat,_pn,_fSava,_dlFolder:string;_typ:Char; _siz:Int64);
procedure _exo_proc_i_dl_explorer(A_ip,A_full_path,A_PN,A_clean_name,A_user_id,A_user_nik,A_sav_file:string;A_typ:char;saz:Int64;xObj:TListItem);
procedure _add_2completed(cap,fullPata,NiK,saZa:string);
procedure _validate_The_Local_folders;
procedure _clear_faster(vv:TListView);
procedure GoFillActualWebPublicComs;
procedure GoSeeIfNewVersionDetected;
function GimeStringBetween(Str,aa,bb:string):string;
function SetStringBetween(Str,aa,bb,NewData:string):string;
procedure _SetFileAssocIcon(f:string;TargetIco:TIcon);
function _getCountryByCode(cod:string):string;
procedure UpdateFavUserNodeCODE(s:string);
function is_fav_allowed_2_do(id:string;op:byte):boolean;
procedure GoCheckLanguageFileAndLoadItIfExists;


procedure GoSetLANG(Compo:TComponent);







implementation
   uses Unit1,_uc_refs_vars,_uc_refs_consts,_uf_debugerLog,
        _uf_start,_i_dl_explorer,registry,_uc_GuiLanG;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
procedure __DoDebugLOG(s:string);
begin
if (_FXOC_MAIN.izDebugerON.Checked) then
_FXOC_MAIN.TheLOGGER.Log(s);


end;


//------------------------------------------------------------------------------
procedure CreateComsOwnWebTab(nama,urla,chata:string);
var
FRMWEB:T_FrameWEB;
_vvTabSHEET:TTabSheet;
i:integer;
begin


_vvTabSHEET:=nil;
(* *)

inc(_DynWebFRAMES_IntNAMES);  // for unique names

  for i:=0 to _FXOC_MAIN.eComsWebsPAGES.PageCount-1 do
  if (_FXOC_MAIN.eComsWebsPAGES.Pages[i].Caption=nama) then
  begin
  _vvTabSHEET:=_FXOC_MAIN.eComsWebsPAGES.Pages[i];
  break;
  end;



  if (_vvTabSHEET=nil) then
  begin
  _vvTabSHEET:=TTabSheet.Create(_FXOC_MAIN.PaneLwebTABS);  // fix ( panel is owner )
  _vvTabSHEET.PageControl:=_FXOC_MAIN.eComsWebsPAGES;
  _vvTabSHEET.Caption:=nama;
  _vvTabSHEET.Hint:=urla;
  _vvTabSHEET.ImageIndex:=70;


  FRMWEB:=T_FrameWEB.Create(_FXOC_MAIN.PaneLwebTABS);  // Same panel is owner    //
  FRMWEB.Parent:=_vvTabSHEET;  // where shit came from
  FRMWEB.Constraints.MaxHeight:= 0;
  FRMWEB.Constraints.MaxWidth:= 0;
  FRMWEB.Constraints.MinHeight:= 0;
  FRMWEB.Constraints.MinWidth:= 0;
  FRMWEB.Align:=alClient;
  FRMWEB._pnnWeb.Anchors:=[akLeft,akTop,akRight,akBottom];
  FRMWEB._pnnChat.Anchors:=[akLeft,akTop,akRight,akBottom];
  FRMWEB.uuuChater.Anchors:=[akTop,akRight];
  FRMWEB.uuuWeber.Anchors:=[akTop,akRight];
  FRMWEB.ebStat.Anchors:=[akLeft,akTop,akRight];
  FRMWEB.StatLabelTitle.Anchors:=[akLeft,akTop,akRight];


  FRMWEB.Hint:=nama; // com name reper!
  FRMWEB.Name:='_FrameWEB_'+IntToStr(_DynWebFRAMES_IntNAMES);
  FRMWEB.sComChatURL:=chata;
  FRMWEB.sComWebURL:=urla;
  FRMWEB.uuuChater.Visible:=(FRMWEB.sComChatURL<>'');
  FRMWEB.uuuWeber.SetAsSELECTED;
  GoSetLANG(FRMWEB); //----- go loadLang --- if ok  (1st here)

  FRMWEB._eweb.Navigate(urla);
 
  end;


end;

//------------------------------------------------------------------------------
procedure GoWebsAssingBLANKPAGES;
var
i,j:integer;
sName:String;
begin

// assign each page to blank we sooon free them

  for i:=0 to _FXOC_MAIN.eComsWebsPAGES.PageCount-1 do
  begin
  sName:=_FXOC_MAIN.eComsWebsPAGES.Pages[i].Caption;

      for j:=0 to _FXOC_MAIN.PaneLwebTABS.ComponentCount-1 do
      if (T_FrameWEB(_FXOC_MAIN.PaneLwebTABS.Components[j]).Hint=sName) then
      begin
      T_FrameWEB(_FXOC_MAIN.PaneLwebTABS.Components[j])._eweb.AssignDocument;
      T_FrameWEB(_FXOC_MAIN.PaneLwebTABS.Components[j])._eChat.AssignDocument;
      break;
      end;

  end;


end;

(*
//------------------------------------------------------------------------------
procedure GoFreeComsOwnDynamicTabs;
var
i,j,k:integer;
sName:String;
begin

  for i:=0 to _FXOC_MAIN.eComsWebsPAGES.PageCount-1 do
  begin
  sName:=_FXOC_MAIN.eComsWebsPAGES.Pages[i].Caption;

      //_1________free__T_FrameWEB______by_hint_com_name
      for j:=0 to _FXOC_MAIN.PaneLwebTABS.ComponentCount-1 do
      if (T_FrameWEB(_FXOC_MAIN.PaneLwebTABS.Components[j]).Hint=sName) then
      begin
      T_FrameWEB(_FXOC_MAIN.PaneLwebTABS.Components[j]).Free;
      break;
      end;

      //_2________free__TTabSheet______by_caption__com_name
      for k:=0 to _FXOC_MAIN.PaneLwebTABS.ComponentCount-1 do
      if (TTabSheet(_FXOC_MAIN.PaneLwebTABS.Components[k]).Caption=sName) then
      begin
      TTabSheet(_FXOC_MAIN.PaneLwebTABS.Components[k]).Free;
      break;
      end;

  


  // we freed so count is dec  >> go ahead ... we exit
  if (_FXOC_MAIN.eComsWebsPAGES.PageCount>0) then GoFreeComsOwnDynamicTabs;
  break;
  end;


end;
*)
//------------------------------------------------------------------------------
procedure GoFreeWebTabOfCommunity(scm:string);
var
i:Integer;
begin


   //_1________free__T_FrameWEB______by_hint_com_name
   for i:=0 to _FXOC_MAIN.PaneLwebTABS.ComponentCount-1 do
   if (T_FrameWEB(_FXOC_MAIN.PaneLwebTABS.Components[i]).Hint=scm) then
   begin
   T_FrameWEB(_FXOC_MAIN.PaneLwebTABS.Components[i]).Parent:=nil;  // the fix
   T_FrameWEB(_FXOC_MAIN.PaneLwebTABS.Components[i]).Free;
   break;
   end;

   //_2________free__TTabSheet______by_caption__com_name
   for i:=0 to _FXOC_MAIN.PaneLwebTABS.ComponentCount-1 do
   if (TTabSheet(_FXOC_MAIN.PaneLwebTABS.Components[i]).Caption=scm) then
   begin
   TTabSheet(_FXOC_MAIN.PaneLwebTABS.Components[i]).Free;
   break;
   end;


end;


//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//----------------------------------------xoc_tab--------------------------------------
function CreateCom_XOC_Tab(nama:string; NodeOfCOM:TTreeNode):T_FrameXOC;
var
uXocFRM_xoc:T_FrameXOC;
uXocTaBSHEET:TTabSheet;
i:integer;
begin

Result:=nil;
uXocTaBSHEET:=nil;


inc(_DynXocFRAMES_IntNAMES);  // for unique names

  for i:=0 to _FXOC_MAIN.eComsXOCsPAGES.PageCount-1 do
  begin

   if (_FXOC_MAIN.eComsXOCsPAGES.Pages[i].Caption=nama) then
   begin
   uXocTaBSHEET:=_FXOC_MAIN.eComsXOCsPAGES.Pages[i];
   break;
   end;

  end;


  if (uXocTaBSHEET=nil) then
  begin
  uXocTaBSHEET:=TTabSheet.Create(_FXOC_MAIN.PaneLxocTABS);
  uXocTaBSHEET.PageControl:=_FXOC_MAIN.eComsXOCsPAGES;
  uXocTaBSHEET.Caption:=nama;   // caption reper
  uXocTaBSHEET.ImageIndex:=43;


  uXocFRM_xoc:=T_FrameXOC.Create(_FXOC_MAIN.PaneLxocTABS);   // Same panel is owner    //
  uXocFRM_xoc.Name:='_FrameXOC_'+IntToStr(_DynXocFRAMES_IntNAMES);
  uXocFRM_xoc.Parent:=uXocTaBSHEET;
  uXocFRM_xoc.Hint:=nama; // hint reper
 
  uXocFRM_xoc.Constraints.MaxHeight := 0;
  uXocFRM_xoc.Constraints.MaxWidth  := 0;
  uXocFRM_xoc.Constraints.MinHeight := 0;
  uXocFRM_xoc.Constraints.MinWidth  := 0;

  uXocFRM_xoc.FrameOwnComNODA:=NodeOfCOM;
  uXocFRM_xoc.xxComTitle.Caption:=uXocFRM_xoc.FrameOwnComNODA.Text;  // uXocFRM_xoc.Name;//
  uXocFRM_xoc.xxComMsg.Caption:=uXocFRM_xoc.FrameOwnComNODA._EXO_NODE_MESSAGE;

  uXocFRM_xoc.Align:=alClient;

  GoSetLANG(uXocFRM_xoc); //----- go loadLang --- if ok  (1st here)

  uXocFRM_xoc.AA_0510_CmCategs.ItemIndex:=0;  // here the index
 
  Result:=uXocFRM_xoc;
  end;





end;


//------------------------------------------------------------------------------
procedure GoFreeComs_Xoc_Tabs;
var
i,j,k:integer;
sName:String;
begin



  for i:=0 to _FXOC_MAIN.eComsXOCsPAGES.PageCount-1 do
  begin
  sName:=_FXOC_MAIN.eComsXOCsPAGES.Pages[i].Caption;


      //_1________free__T_FrameXOC______by_hint_com_name
      for j:=0 to _FXOC_MAIN.PaneLxocTABS.ComponentCount-1 do
      if (T_FrameXOC(_FXOC_MAIN.PaneLxocTABS.Components[j]).Hint=sName) then
      begin
      //ShowMessage(T_FrameXOC(_FXOC_MAIN.PaneLkkTABS.Components[j]).Name);
      T_FrameXOC(_FXOC_MAIN.PaneLxocTABS.Components[j]).Free;
      break;
      end;

     
      //ShowMessage(sName+'__1');
      //_2________free__TTabSheet______by_caption__com_name
      for k:=0 to _FXOC_MAIN.PaneLxocTABS.ComponentCount-1 do
      if (TTabSheet(_FXOC_MAIN.PaneLxocTABS.Components[k]).Caption=sName) then
      begin
      TTabSheet(_FXOC_MAIN.PaneLxocTABS.Components[k]).Free;
      break;
      end;

      //ShowMessage(sName+'__2');

  // we freed so count is dec  >> go ahead ... we exit
  if (_FXOC_MAIN.eComsXOCsPAGES.PageCount>0) then GoFreeComs_Xoc_Tabs;
  break;
  end;


end;

//------------------------------------------------------------------------------
procedure GoFreeXocTabOfCommunity(scc:string);
var
i,j,k:integer;
begin



  for i:=0 to _FXOC_MAIN.eComsXOCsPAGES.PageCount-1 do
  if (scc=_FXOC_MAIN.eComsXOCsPAGES.Pages[i].Caption) then
  begin


      //_1________free__T_FrameXOC______by_hint_com_name
      for j:=0 to _FXOC_MAIN.PaneLxocTABS.ComponentCount-1 do
      if (T_FrameXOC(_FXOC_MAIN.PaneLxocTABS.Components[j]).Hint=scc) then
      begin
      //ShowMessage(T_FrameXOC(_FXOC_MAIN.PaneLxocTABS.Components[j]).Name);
      T_FrameXOC(_FXOC_MAIN.PaneLxocTABS.Components[j]).Free;
      break;
      end;

     
      //_2________free__TTabSheet______by_caption__com_name
      for k:=0 to _FXOC_MAIN.PaneLxocTABS.ComponentCount-1 do
      if (TTabSheet(_FXOC_MAIN.PaneLxocTABS.Components[k]).Caption=scc) then
      begin
      TTabSheet(_FXOC_MAIN.PaneLxocTABS.Components[k]).Free;
      break;
      end;


  break; // break, only 1 com to close
  end;


end;


//------------------------------------------------------------------------------
function GetCategNAME(i:Byte):String;
begin

Result:='----';

 Case i of
   1 : Result:=___ccc__0027__Applications;
   2 : Result:=___ccc__0028__Audio;
   3 : Result:=___ccc__0029__Video;
   4 : Result:=___ccc__0030__Others;
 end;

end;

//------------------------------------is_ip_tzz------------------------------------------
function is_ip_tzz(x:string):byte;
var
s:string[15];          // 10.0.0.0        -   10.255.255.255  (10/8 prefix)
begin                  // 172.16.0.0      -   172.31.255.255  (172.16/12 prefix)
                       // 192.168.0.0     -   192.168.255.255 (192.168/16 prefix)
Result:=0;
s:=copy(x,1,7);

  if (s='127.0.0') or (s='192.168') or (s='169.254') then Result:=1;
  if (copy(x,1,4)='172.') and (s[7]='.') then
  begin
  if (strtoint(copy(x,5,2))>=16) and (strtoint(copy(x,5,2))<=31)then Result:=2;  // 172 LAN detection
  end;

end;

//------------------------------------------------------------------------------
procedure InitialiseLocals;
begin

_VV_LOCAL_USER_IP_MASTER:=_FXOC_MAIN._TExoSeeSERVER.socket.Local_ip;
_VV_LOCAL_USER_IP_OTHERS:=_FXOC_MAIN._TExoSeeSERVER.Socket.PC_ips; // in tekno to verify tzz-ips not one of mine
_VV_LOCAL_USER_IP_IS_OK_WAN:=(is_ip_tzz(_VV_LOCAL_USER_IP_MASTER)=0); //must be before proccess

if (_VV_LOCAL_CONFIG_ROUTER_IS_ON) then _VV_LOCAL_USER_IP_IS_OK_WAN:=true;

  if _VV_LOCAL_USER_IP_IS_OK_WAN then
       _VV_LOCAL_USER_MY8_BOOLEANS[1]:='W'
  else _VV_LOCAL_USER_MY8_BOOLEANS[1]:='L';

// version
_VV_LOCAL_USER_MY8_BOOLEANS[3]:=_APPLICATION_VERSION_STR[1];
_VV_LOCAL_USER_MY8_BOOLEANS[4]:=_APPLICATION_VERSION_STR[2];
_VV_LOCAL_USER_MY8_BOOLEANS[5]:=_APPLICATION_VERSION_STR[3];
end;

//------------------------------------------------------------------------------
function GetLocalPcID: string;
var
vol,t,a,b: DWORD;
begin

t:=2156;
if GetVolumeInformation('c:\', NIL, 0, @vol, a, b, NIL, 0) then
begin
if vol>3148 then vol:=vol-2156 else vol:=vol+2156;
t:=vol;
result:=Format('1E%.8x', [t]);
end
else result:=Format('1E%.8x', [t]);

//if a_change_id then result:=Format('3F%.8x', [t+1]);

end;
//------------------------------------------------------------------------------
procedure LoadGuiNodes;
begin



_VV_LOCAL_USER_MY8_BOOLEANS[2]:=Char(_VV_LOCAL_USER_LOGO_BYTE);



_TV_NODE_OF_HOME_ROOT:=_FXOC_MAIN._eExplorerTV.Items.AddChild(nil,___ccc__0525__Home); // 'Home'  _EXPLORER_NODE
_TV_NODE_OF_HOME_ROOT._EXO_NODE_X_LEVEL   :='.';
_TV_NODE_OF_HOME_ROOT.ImageIndex          :=0;



_TV_NODE_OF_LOCAL_USER             :=_FXOC_MAIN._eExplorerTV.Items.AddChild(_TV_NODE_OF_HOME_ROOT,_VV_LOCAL_USER_NIKO);
_TV_NODE_OF_LOCAL_USER._EXO_NODE_X_LEVEL         :='Z';
if _VV_LOCAL_USER_IP_IS_OK_WAN then _TV_NODE_OF_LOCAL_USER.ImageIndex:=1 else _TV_NODE_OF_LOCAL_USER.ImageIndex:=2;
_TV_NODE_OF_LOCAL_USER._EXO_NODE_USER_IP         :=_VV_LOCAL_USER_IP_MASTER;
_TV_NODE_OF_LOCAL_USER._EXO_NODE_MESSAGE         :=_VV_LOCAL_USER_MESSAGE;
_TV_NODE_OF_LOCAL_USER._EXO_NODE_USER_ID         :=_VV_LOCAL_USER_PC_ID;
_TV_NODE_OF_LOCAL_USER._EXO_NODE_COUNTRY         :=_getCountryByCode(_VV_LOCAL_USER_COUNTRY_CODE);
////_MY_NODE._EXO_NODE_COM_IDX         :='LOCAL';
_TV_NODE_OF_LOCAL_USER._EXO_NODE_20BOOLS         :=_VV_LOCAL_USER_MY8_BOOLEANS;
_TV_NODE_OF_LOCAL_USER._EXO_NODE_PATH_NB         :='00';// hexa roots
_TV_NODE_OF_LOCAL_USER._EXO_NODE_PATH_TX         :='\';// roots
_TV_NODE_OF_LOCAL_USER._EXO_NODE_XP_TYPE         :='*';// just a fill
_TV_NODE_OF_LOCAL_USER._EXO_NODE_ROOT_HD         :=_TV_NODE_OF_LOCAL_USER.ItemId;  // self handle
//_MY_NODE._EXO_NODE_RECEVED         :=0;


_TV_NODE_OF_FAVORITES:=_FXOC_MAIN._eExplorerTV.Items.AddChild(_TV_NODE_OF_HOME_ROOT,___ccc__0031__Favorites); //   _TV_NODE_OF_FAVORITES
_TV_NODE_OF_FAVORITES._EXO_NODE_X_LEVEL   :='F';
_TV_NODE_OF_FAVORITES.ImageIndex          :=48;


_TV_NODE_OF_COMMUNITIES:=_FXOC_MAIN._eExplorerTV.Items.AddChild(nil,___ccc__0032__Communities); //   _EXPLORER_NODE
_TV_NODE_OF_COMMUNITIES._EXO_NODE_X_LEVEL   :='E';
_TV_NODE_OF_COMMUNITIES.ImageIndex          :=69;





_TV_NODE_OF_HOME_ROOT.Expand(false);



end;

//----------------------------is_user-Com_in_home--------------------------------------------
function is_COMMUNITY_in_HOME(comADR: string): TTreeNode;
var
i:integer;
begin

result:=nil;
if comADR='' then exit;

for i:=0 to _TV_NODE_OF_COMMUNITIES.Count-1 do
begin
     if (_TV_NODE_OF_COMMUNITIES.Item[i]._EXO_NODE_COM_IDX=comADR) then   // ip of node its comNODE contact address
     begin
     result:=_TV_NODE_OF_COMMUNITIES.Item[i];
     break;
     end;
end;


end;
//----------------------------user_id_in_tree_wherever_he_is--------------------------------------------
function is_user_in_this_ComNode(id: string;comNody:TTreeNode): TTreeNode;
var
i:integer;
begin

Result:=nil;

//if id=_V_LOCAL_ID then begin Result:=_MY_NODE; exit; end;


for i:=0 to comNody.Count-1 do
begin

   if comNody.Item[i]._EXO_NODE_USER_ID=id then
   begin
   Result:=comNody.Item[i];
   break;
   end;

end;

end;

//----------------------------user_id_in_tree_wherever_he_is--------------------------------------------
function _is_UserID_in_The_NETWORKS_Tree(id: string): TTreeNode;
var
i,j:integer;
_Broken:Boolean;
begin

Result:=nil;
_Broken:=false;

if id='' then exit;
if id=_VV_LOCAL_USER_PC_ID then begin Result:=_TV_NODE_OF_LOCAL_USER; exit; end;


// important : result can send other com, except the one is  _EXO_NODE_IS_STOPING

     for i:=0 to _TV_NODE_OF_COMMUNITIES.Count-1 do
     if NOT(_TV_NODE_OF_COMMUNITIES.Item[i]._EXO_NODE_IS_STOPING) then
     begin

           for j:=0 to _TV_NODE_OF_COMMUNITIES.Item[i].Count-1 do
           begin
             if _TV_NODE_OF_COMMUNITIES.Item[i].Item[j]._EXO_NODE_USER_ID=id then
             begin
             Result:=_TV_NODE_OF_COMMUNITIES.Item[i].Item[j];
             _Broken:=true;
             break;
             end;
           end;

     if _Broken then break;
     end;

end;

//------------------------------------------------------------------------------
function _octos(n:int64):string;
begin

case n of
  0..999                   : result := format('%d Bytes',[n]);   //up to 1 KB,   returns 'x bytes'
  1000..999999             : result := format('%.2f KB',[n/1000]);   //up to 10 KB,  returns 'x.xx KB'
  1000000..999999999       : result := format('%.2f MB',[n/1000000]);   //up to 100 KB, returns 'x.x KB'
end;

if n >= 1000000000 then result := format('%.2f GB',[n/1000000000]);

end;

//------------------------------------------------------------------------------
function _percenty(red,saz: Int64): Int64;
begin
if saz = 0 then Result := 0
else Result := Int64(Trunc( (red * 100.0) / saz ));
end;

//------------------------------------------------------------------------------
function _percentyV2(red,saz: Int64): String;
begin
if saz=0 then Result :='0.00'
else Result := format('%.2f %%', [(red * 100) / saz]);
end;


//------------------------------------------------------------------------------
function _folder_lastName(s:string):string;
var i:integer;
begin
result:='';

  for i:=length(s)-1 downto 1 do
  begin
  if s[i]='\' then break;
  result:=s[i]+result;
  end;

end;


//------------------------------------------------------------------------------
function _GimeFavUserXtraFolder(id:string):string;
var
i:integer;
s:string;
begin

result:='';
//// 1C080B2CD3.xx.A.01000000.%1uZerNameG%2F:\_Pc-Set\_Drivers%3

 for i:=0 to _TV_NODE_OF_FAVORITES.Count-1 do
 begin
 s:=_TV_NODE_OF_FAVORITES.Item[i]._EXO_NODE_COM_IDX;

   if copy(s,1,10)=id then begin
                           result:=copy(s,pos('%2',s)+2,pos('%3',s)-pos('%2',s)-2);
                           break;
                           end;
 end;

end;

//------------------------------------------------------------------------------
procedure _pp_xpoz_menu_on(sNode:TTreeNode);
var
i:integer;
_sTrNIK:string;
_DaddaCOM: TTreeNode;
begin



if (sNode=nil) then exit;



with _FXOC_MAIN do
begin

for i:=0 to _pp_xpoz.Items.Count-1 do begin _pp_xpoz.Items[i].Visible:=false; end; // hide all ppItems


            case sNode._EXO_NODE_X_LEVEL of

         'Z','M' : begin    //  a user or a fav-active
                   _sTrNIK:=_eExplorerTV.Items.getnode(sNode._EXO_NODE_ROOT_HD).Text;
                   _DaddaCOM:=_eExplorerTV.Items.getnode(sNode._EXO_NODE_ROOT_HD).Parent; // daddy( com )
                   //if sNode.Level
                   xplorupdate.Caption :=___ccc__0033__UpdateFolder;//+sNode._EXO_NODE_PATH_TX;
                   xplorupdate.Visible :=true;
                   N3.Visible          :=true;

                   _mn_chat.Caption          :=format(___ccc__0034__ChatWith,[_sTrNIK]);
                   _mn_chat.Visible          :=true;

                   _mn_add2Favs.Caption      :=format(___ccc__0035__AddToFav,[_sTrNIK]);
                   _mn_add2Favs.Visible      :=true;
                   _mn_add2Favs.Enabled      :=pos(sNode._EXO_NODE_USER_ID,_VV_LOCAL_USER_FAVORITES_LIST)=0;

                   _mn_zundFile.Caption      :=format(___ccc__0036__SendFileTo,[_sTrNIK]);
                   _mn_zundFile.Visible      :=true;

                   _mn_zundFolder.Caption    :=format(___ccc__0037__SendFolder,[_sTrNIK]);
                   _mn_zundFolder.Visible    :=true;

                   _mn_RemUser.Caption       :=format(___ccc__0038__BanUser,[_sTrNIK]);
                   _mn_RemUser.Enabled       :=(pos(sNode._EXO_NODE_USER_ID,_VV_LOCAL_USER_FAVORITES_LIST)=0);   // no favs
                   _mn_RemUser.Visible       :=(sNode._EXO_NODE_USER_ID<>_VV_LOCAL_USER_PC_ID);

                   _mn_delfav.Caption      :=format(___ccc__0039__DelFromFav,[_sTrNIK]);
                   _mn_delfav.Visible      :=(sNode._EXO_NODE_X_LEVEL='M');

                   _mn_infoUser.Caption      :=___ccc__0518__UserInfo;
                   _mn_infoUser.Visible      :=true;
                  // AA_0430_OpnFolder.Visible:=(_eExplorerTV.Items.getnode(sNode._EXO_NODE_ROOT_HD)=_TV_NODE_OF_LOCAL_USER);

                   if (_DaddaCOM <> nil) then  // to avoid me ( no parent )
                   begin

                           case _DaddaCOM._EXO_NODE_XP_TYPE of
                              'A' : begin  // admin
                                    _mn_NetAdmin.Caption  :=_DaddaCOM.Text+' : '+___ccc__0040__Administrator;
                                    _mn_NetAdmin.Visible  :=(sNode._EXO_NODE_USER_ID<>_VV_LOCAL_USER_PC_ID); // true
                                    _mn_adminBan.Caption  :=format(___ccc__0042__BanFromCom,[_sTrNIK]);
                                    //_mn_SetasRegistred register user
                                    end;
                              'M' : begin  // Mod
                                    _mn_NetMod.Caption    :=_DaddaCOM.Text+' : '+___ccc__0041__Moderator;
                                    _mn_NetMod.Visible    :=(sNode._EXO_NODE_USER_ID<>_VV_LOCAL_USER_PC_ID); //true
                                    _mn_modBan.Caption    :=format(___ccc__0042__BanFromCom,[_sTrNIK]);
                                    _mn_modBan.Visible    :=true;
                                    end;
                           end;

                     end;

                   end;



             'C' : begin    // Community Main Node
                   _mn_StopCom.Caption   :=___ccc__0043__StopCom+' : '+sNode.Text;
                   _mn_StopCom.Visible   :=true;
                   _mn_comPropes.Caption :=___ccc__0044__ComProps;
                   _mn_comPropes.Visible :=true;

                   end;

             'L' : begin    // Community Main Node
                   _sTrNIK:=_eExplorerTV.Items.getnode(sNode._EXO_NODE_ROOT_HD).Text;
                   _mn_delfav.Caption      :=format(___ccc__0039__DelFromFav,[_sTrNIK]);
                   _mn_delfav.Visible      :=true;//(sNode._EXO_NODE_X_LEVEL in ['L','M']);
                   //_mn_delfav.Enabled      :=pos(sNode._EXO_NODE_USER_ID,_VV_LOCAL_CONFIG_FAVORITES_LIST)=0;

                   end;


            end;




end;

end;


//------------------------------------------------------------------------------
procedure _put_DW_vItem(_cap,_nik,_ip,_id,_fullPat,_pn,_fSava,_dlFolder:string;_typ:Char; _siz:Int64);
var
_vD:TListItem;
begin


_vD:=_FXOC_MAIN.AA_0516_vTraffic.FindCaption(0,_cap,false,true,false);

//avoid upload item      //// try add find id too to exact item
if (_vD=nil) then _vD:=_FXOC_MAIN.AA_0516_vTraffic.Items.Add else _vD.SubItems.Clear;

_vD.Caption    :=_cap;
_vD.ImageIndex :=49;
_vD.SubItems.Add(_octos(_siz));
_vD.SubItems.Add('0');
_vD.SubItems.Add('0,00');
_vD.SubItems.Add('%');
_vD.SubItems.Add(_nik); // nik
_vD.SubItems.Add(___ccc__0045__Connecting);   // connecting ...




  _vD.itm_str1   :=_ip;  // ip    as in i-ixploration
  _vD.itm_str2   :=_fullPat;  // full path   as in i-ixploration
  _vD.dl_path    :=_dlFolder;// for folder/dl via explorer
  _vD.pat_n      :=_pn;
  _vD.sava_f     :=_fSava;
  _vD.uzr_id     :=_id;
  _vD.ITM_F_SIZE :=_siz;//size_stok   int64
  _vD.ITM_READEN :=0;

  _vD.itm_int1   :=0; // for kbs last_size
  _vD.itm_int2   :=0; //percent

  _vD._Type      :=_typ;


  _vD._Pozo      :=6;  // 6 to give more control on 1 file per usr

  if not FileExists(_VV_LOCAL_CONFIG_THE_DOWNLOADS_FOLDER+_fSava) then FileClose(FileCreate(_VV_LOCAL_CONFIG_THE_DOWNLOADS_FOLDER+_fSava)); // put file new $$_xxxxx to be resumed

end;

//---------------------------_exo_proc_i_dl_explorer------------------------------
//------------------------------------------------------------------------------
procedure _exo_proc_i_dl_explorer(A_ip,A_full_path,A_PN,A_clean_name,A_user_id,A_user_nik,A_sav_file:string;A_typ:char;saz:Int64;xObj:TListItem);
begin

   with T_i_dl_explorer_THREAD.Create do
   begin

     _ip         :=A_ip;
     _full_file  :=A_full_path; // full
     _pn         :=A_PN; // pn
     _tp         :=A_typ;
     _sav_file   :=_VV_LOCAL_CONFIG_THE_DOWNLOADS_FOLDER + A_sav_file; //add local dl folder //  $$_00000000FFFFFFFFFFWinzip.exe file to save
    // _sav_file   :=stringreplace(_sav_file,'\\','\',[rfReplaceAll]); // clean local file path


   _c_item:=xObj;
   //avoid upload item      //// try add find id too to exact item
   if _c_item=nil then _c_item:=_FXOC_MAIN.AA_0516_vTraffic.items.add;


     _c_item.caption :=A_clean_name;

     _c_item.ITM_READEN :=0;
     _c_item.itm_str1   :=A_ip;//ip_stok
     _c_item.itm_str2   :=A_full_path;//full_file_stok
     _c_item.pat_n      :=A_PN;//pn
     _c_item.ITM_F_SIZE :=saz;//size_stok
     _c_item.uzr_id     :=A_user_id;// user_id_stok
     _c_item.sava_f     :=A_sav_file; // sava stok

     _c_item.itm_int1   :=0; // for kbs last_size
     _c_item.itm_int2   :=0; //percent

     _c_item.set_cancel :=false;   // to cancel
     _c_item.set_stop   :=false;   // to stop




    // _c_item.Caption    :=A_clean_name;  // to show clean
     _c_item.imageIndex :=13;
     //_c_item.__Put_SubItem(_c_item._iTemIndex,3,_Cc_sConnecting);// status
     //_c_item.__Put_SubItem(_c_item._iTemIndex,4,''); // progress , put any to update
     //_c_item.__Put_SubItem(_c_item._iTemIndex,7,A_user_nik); // A_user_nik
           // _c_item.__Put_SubItem(_c_item._iTemIndex,1,_octos(saz));//      SubItems.Add(_octos(saz)); //size



     _c_item.SubItems.Add('0');  // //read
     _c_item.SubItems.Add('0,00');  //  kb/s
     _c_item.SubItems.Add('%.');  //  %
     _c_item.SubItems.Add(A_user_nik);
     _c_item.SubItems.Add(___ccc__0045__Connecting);


     _c_item._Pozo      :=10;

   Resume;


   end;


end;

//------------------------------------------------------------------------------
procedure _add_2completed(cap,fullPata,NiK,saZa:string);
var
v:TListItem;
//ic:word;
//ico:TIcon;
begin


//ico:=TIcon.Create;
//ico.Handle := extractassociatedicon(Application.Handle,pchar(fullPata),ic);
//_fgui._images.ReplaceIcon(47,ico);
//ico.Free;

v              :=_FXOC_MAIN.AA_0517_vCompleted.Items.Add;
v.Caption      :=cap;
v.imageIndex  :=15;
v.SubItems.Add(saZa);
v.SubItems.Add(NiK);
v.sava_f      :=fullPata;

end;

//------------------------------------------------------------------------------
procedure _validate_The_Local_folders;
var
i:integer;
begin


// pubs
for i:=0 to EXPLORER_PUBLIC_ROOTS.Count-1 do
if not DirectoryExists(EXPLORER_PUBLIC_ROOTS[i]) then
begin
_FXOC_MAIN.TheLOGGER.Log(format(___ccc__0046__CheckPubFolder,[EXPLORER_PUBLIC_ROOTS[i]]),1);
end;

//privs
for i:=0 to EXPLORER_PRIVATE_ROOTS.Count-1 do
if not DirectoryExists(EXPLORER_PRIVATE_ROOTS[i]) then
begin
_FXOC_MAIN.TheLOGGER.Log(format(___ccc__0046__CheckPrivFolder,[EXPLORER_PRIVATE_ROOTS[i]]),1);
end;

if not DirectoryExists(_VV_LOCAL_CONFIG_THE_DOWNLOADS_FOLDER)
then _VV_LOCAL_CONFIG_THE_DOWNLOADS_FOLDER:=ExtractFilePath(ParamStr(0));

if not DirectoryExists(_VV_LOCAL_CONFIG_THE_DOWNLOADS_FOLDER+'Completed\')
  then CreateDir(_VV_LOCAL_CONFIG_THE_DOWNLOADS_FOLDER+'Completed\');

 
end;

//------------------------------------------------------------------------------
procedure _clear_faster(vv:TListView);
var
i:integer;
begin

try

vv.Items.BeginUpdate;
for i:=0 to vv.Items.Count -1 do
begin
vv.Items[0].Delete;
//Application.ProcessMessages;
end;
vv.Items.EndUpdate;

except vv.Items.Clear; end;

end;

//------------------------------------------------------------------------------
procedure GoFillActualWebPublicComs;
var
i:integer;
Reg:TRegistry;
s,val:string;
v:tlistitem;
begin


Reg := TRegistry.Create;
try
Reg.OpenKey('\Software\'+_APPLICATION_REGISTRY_NAME+'\Communities',true);

    for i:=0 to _PublicWebComsList.Count-1 do
    begin
    s:=_PublicWebComsList[i];
    if (s='')or(length(s)<3) then continue;

         if s[1]='$' then // ok is paramater
         begin
         Delete(s,1,1);
            //  http://www.aaa.com/
            if (s[5]=':') and (s[length(s)]='/') and (_VV_COMMUNITIES_LIST.IndexOf(s)=-1)then //
            begin
            v:=_FXOC_START.LvSTART.Items.Add;
            v.Caption:=s;
            v.ImageIndex:=0;
            v.sava_f:=s;   // sava_f has whole com
            v.pat_n:='100';
           
            val:=SetStringBetween(val,'$µA','$µB',s);
            val:=SetStringBetween(val,'$µE','$µF',v.pat_n);

            _VV_COMMUNITIES_LIST.Add(s);
            Reg.WriteString(s,val);
            end;

         end;

    end;

Reg.CloseKey;
finally Reg.Free; end;

if (_NEW_VERSION_IS_VAILABLE) then _FXOC_MAIN.TmVersionNOTIFY.Enabled:=true;

end;

//------------------------------------------------------------------------------
procedure GoSeeIfNewVersionDetected;
var
i:integer;
s:string;
begin


    for i:=0 to _PublicWebComsList.Count-1 do
    begin
    s:=_PublicWebComsList[i];
    if (s='')or(length(s)<3) then continue;

         //version check
         if (s[1]='%') then
         begin
         _NEW_VERSION_STRING:=copy(s,2,3);
         if (StrToIntDef(_NEW_VERSION_STRING,0)>_APPLICATION_VERSION_INT) then _NEW_VERSION_IS_VAILABLE:=true;
         Break;
         end;

    end;


if (_NEW_VERSION_IS_VAILABLE) then _FXOC_MAIN.TmVersionNOTIFY.Enabled:=true;
end;

//------------------------------------------------------------------------------
function GimeStringBetween(Str,aa,bb:string):string;
var
p1,p2,LLa:Integer;
begin

Result:='';


 p1:=pos(aa,Str);
 p2:=pos(bb,Str);

 LLa:=length(aa);

 if (p1>0)and(p2>0)and(p2>p1) then
 begin
 Result:=Copy(Str,p1+LLa,(p2-p1)-LLa);
 end;

end;

//------------------------------------------------------------------------------
function SetStringBetween(Str,aa,bb,NewData:string):string;
var
p1,p2,LLa:Integer;
ss:string;
begin

Result:='';
// zzzz$µAnnnnnnnnnn$µBiiiiiiii...       ,vComNAME

 p1:=pos(aa,Str);
 p2:=pos(bb,Str);

 LLa:=length(aa);

 if (p1>0)and(p2>0)and(p2>p1) then
 begin
 ss:=Copy(Str,p1+LLa,(p2-p1)-LLa);
 Result:=StringReplace(Str,aa+ss+bb,aa+NewData+bb,[rfReplaceAll]);
 end
 else
 Result:=Str+aa+NewData+bb;



end;

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
procedure _SetFileAssocIcon(f:string;TargetIco:TIcon);
var
  _Index: word;
  Buffer: array[0..512] of char;
  IcoHandle:  HIcon;
begin

  StrCopy(@Buffer, pchar(f));
  _Index := 0;
  IcoHandle := ExtractAssociatedIcon(HInstance, Buffer, _Index);
  if IcoHandle <> 0 then TargetIco.Handle:=IcoHandle;
 
end;

//------------------------------------------------------------------------------
function _getCountryByCode(cod:string):string;
var
reg:tregistry;
begin

  result:='';
  Reg := TRegistry.Create;
  reg.RootKey:=HKEY_LOCAL_MACHINE;
  try
  if Reg.OpenKey('\SOFTWARE\Microsoft\Windows\CurrentVersion\Telephony\Country List\'+cod,false) then
  result:=reg.ReadString('Name');
  finally Reg.CloseKey; Reg.Free; end;

end;

//------------------------------------------------------------------------------
procedure UpdateFavUserNodeCODE(s:string);
var
i:Integer;
begin


    for i:=0 to _TV_NODE_OF_FAVORITES.Count-1 do
    begin

        if  copy(s,1,10)=copy(_TV_NODE_OF_FAVORITES.Item[i]._EXO_NODE_COM_IDX,1,10) then
        begin
        _TV_NODE_OF_FAVORITES.Item[i]._EXO_NODE_COM_IDX:=s;
        break;
        end;

    end;


end;

//------------------------------------------------------------------------------
function is_fav_allowed_2_do(id:string;op:byte):boolean;
var
i:integer;
e:string;
begin

result:=false;

//// 1C080B2CD3.xx.A.01000000.%1uZerNameG%2F:\_Pc-Set%3

for i:=0 to _TV_NODE_OF_FAVORITES.Count-1 do
begin
e:=_TV_NODE_OF_FAVORITES.Item[i]._EXO_NODE_COM_IDX;

  if copy(e,1,10)=id then
  begin
  if e[13+op]='1' then result:=true;
  break;
  end;

end;

end;

//------------------------------------------------------------------------------
procedure GoCheckLanguageFileAndLoadItIfExists;
begin

_VV_THE_LANGUAGE_FILE_EXISTS:=(FileExists(ExtractFilePath(ParamStr(0))+_LANGUAGE__xLANG_FILE));

if (_VV_THE_LANGUAGE_FILE_EXISTS) then GoLoadUserGuiLanguageIniFile;

end;

//------------------------------------------------------------------------------
procedure GoSetLANG(Compo:TComponent);
var
i:Integer;
CoName:string;
zCOD:Integer;
TheKompo:TComponent;
begin


if NOT(_VV_THE_LANGUAGE_FILE_EXISTS) then exit;

// ___ccc__0400__Start        : string = 'démarrage';
//AA_0400_Start1
//_FXOC_MAIN.TheLOGGER.Log(compo.Components[i].Name);
//AA_0500_eFileMainMENU

(*
'AA_' to detect form sender components to translate


0400 - 0499  = TMenuItem
0500 - ....  = TControl
*)


   for i:=0 to compo.ComponentCount-1 do
   begin
   TheKompo:=compo.Components[i];
   CoName:=TheKompo.Name;

       if (pos('AA_',CoName)=1) then
       begin

       //if TheKompo is TControl then TControl(TheKompo).SetTextBuf(pchar(___ccc__0400__Start));

       zCOD:=StrToIntDef(Copy(CoName,4,4),0);

          Case zCOD of

            0400 .. 0499 : Case zCOD of // TMenuItems -----------------------------
                           0400 : TMenuItem(TheKompo).Caption:=___ccc__0400__Start;
                           0401 : TMenuItem(TheKompo).Caption:=___ccc__0401__Settings;
                           0402 : TMenuItem(TheKompo).Caption:=___ccc__0402__OpenMyDlFolder;
                           0403 : TMenuItem(TheKompo).Caption:=___ccc__0403__MyOnlineStatus;
                           0404 : TMenuItem(TheKompo).Caption:=___ccc__0001__Online; //*
                           0405 : TMenuItem(TheKompo).Caption:=___ccc__0002__Away;   //*
                           0406 : TMenuItem(TheKompo).Caption:=___ccc__0406__SetAwayMsg;
                           0407 : TMenuItem(TheKompo).Caption:=___ccc__0407__Tools;
                           0408 : TMenuItem(TheKompo).Caption:=___ccc__0408__Help;
                           0409 : TMenuItem(TheKompo).Caption:=___ccc__0409__OnlineHelp;
                           0410 : TMenuItem(TheKompo).Caption:=___ccc__0410__ExoSeeHomepage;
                           0411 : TMenuItem(TheKompo).Caption:=___ccc__0411__XOChomepage;
                           0412 : TMenuItem(TheKompo).Caption:=___ccc__0412__SupportForum;
                           0413 : TMenuItem(TheKompo).Caption:=___ccc__0413__About;
                           0414 : TMenuItem(TheKompo).Caption:=___ccc__0414__Exit;
                           0415 : TMenuItem(TheKompo).Caption:=___ccc__0415__Resume;
                           0416 : TMenuItem(TheKompo).Caption:=___ccc__0556__AddCom;
                           0417 : TMenuItem(TheKompo).Caption:=___ccc__0557__DelCom;
                           0418 : TMenuItem(TheKompo).Caption:=___ccc__0559__UpdateList;
                           0419 : TMenuItem(TheKompo).Caption:=___ccc__0067__Properties;
                           0420 : TMenuItem(TheKompo).Caption:=___ccc__0420__OpenComIE;
                           0421 : TMenuItem(TheKompo).Caption:=___ccc__0421__CloseWeb;
                           0422 : TMenuItem(TheKompo).Caption:=___ccc__0044__ComProps;
                           0423 : TMenuItem(TheKompo).Caption:=___ccc__0416__XocInfo;
                           0424 : TMenuItem(TheKompo).Caption:=___ccc__0022__Download;
                           0425 : TMenuItem(TheKompo).Caption:=___ccc__0040__Administrator;
                           0426 : TMenuItem(TheKompo).Caption:=___ccc__0041__Moderator;
                           0427 : TMenuItem(TheKompo).Caption:=___ccc__0417__DelComXOC;
                           0428 : TMenuItem(TheKompo).Caption:=___ccc__0418__GenerateXOCLinks;
                           0429 : TMenuItem(TheKompo).Caption:=___ccc__0563__AddXOC;
                           0430 : TMenuItem(TheKompo).Caption:=___ccc__0107__OpenThisFolder;
                           0431 : TMenuItem(TheKompo).Caption:=___ccc__0404__Cancel;
                           0432 : TMenuItem(TheKompo).Caption:=___ccc__0405__Stop;
                           0433 : TMenuItem(TheKompo).Caption:=___ccc__0422__IconsHelp;

                           end;


                    0500 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0501 : TControl(TheKompo).SetTextBuf(pchar(' '+___ccc__0501__Explorer));
                    0502 : TControl(TheKompo).SetTextBuf(pchar(' '+___ccc__0502__Traffic));
                    0503 : TControl(TheKompo).SetTextBuf(pchar(' '+___ccc__0503__ComsOnline));
                    0504 : TControl(TheKompo).SetTextBuf(pchar(' '+___ccc__0504__Log));
                    0505 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0403__MyOnlineStatus+' :'));


                    0506 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0505__RULES));
                    0507 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0612__NewVersNotify));
                    0508 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0509 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));


                    //--------- specials-------------------------------------------------start

                    0510 : begin  // xoc/db categs items
                           TComboBox(TheKompo).Items[0]:=___ccc__0419__All;
                           TComboBox(TheKompo).Items[1]:=___ccc__0027__Applications;
                           TComboBox(TheKompo).Items[2]:=___ccc__0028__Audio;
                           TComboBox(TheKompo).Items[3]:=___ccc__0029__Video;
                           TComboBox(TheKompo).Items[4]:=___ccc__0030__Others;
                           end;

                    0511 : begin  // add xoc categs items
                           TComboBox(TheKompo).Items[0]:=___ccc__0027__Applications;
                           TComboBox(TheKompo).Items[1]:=___ccc__0028__Audio;
                           TComboBox(TheKompo).Items[2]:=___ccc__0029__Video;
                           TComboBox(TheKompo).Items[3]:=___ccc__0030__Others;
                           end;
                    (*  *)
                    0512 : begin  // settings LV items
                           TListView(TheKompo).Items[0].Caption:=___ccc__0517__General;
                           TListView(TheKompo).Items[1].Caption:=___ccc__0518__UserInfo;
                           TListView(TheKompo).Items[2].Caption:=___ccc__0519__SharedFolders;
                           TListView(TheKompo).Items[3].Caption:=___ccc__0520__PrivateFolders;
                           TListView(TheKompo).Items[4].Caption:=___ccc__0521__FavoritesOptions;
                           TListView(TheKompo).Items[5].Caption:=___ccc__0522__XOCdbLinks;
                           end;

                   
                    0513 : begin  // settings fav items
                           TListView(TheKompo).Columns[0].Caption:=___ccc__0523__FavNickname;
                           TListView(TheKompo).Columns[1].Caption:=___ccc__0516__Status;
                           end;

                    0514 : begin  // xoc-db LV items
                           TListView(TheKompo).Columns[0].Caption:=___ccc__0512__Filename;
                           TListView(TheKompo).Columns[1].Caption:=___ccc__0511__Size;
                           TListView(TheKompo).Columns[2].Caption:=___ccc__0524__Category;
                           end;

                    0515 : begin  // explorer LV items
                           TListView(TheKompo).Columns[0].Caption:=___ccc__0510__FolderAndFilename;
                           TListView(TheKompo).Columns[1].Caption:=___ccc__0511__Size;
                           end;

                    0516 : begin  // Traffic LV items
                           TListView(TheKompo).Columns[0].Caption:=___ccc__0512__Filename;
                           TListView(TheKompo).Columns[1].Caption:=___ccc__0511__Size;
                           TListView(TheKompo).Columns[2].Caption:=___ccc__0513__ReadAndSent;
                           TListView(TheKompo).Columns[3].Caption:=___ccc__0514__Speed;
                           //TListView(TheKompo).Columns[4].Caption:=___ccc__0511__Size;  // %
                           TListView(TheKompo).Columns[5].Caption:=___ccc__0515__User;
                           TListView(TheKompo).Columns[6].Caption:=___ccc__0516__Status;
                           end;

                    0517 : begin  // Completed LV items
                           TListView(TheKompo).Columns[0].Caption:=___ccc__0512__Filename;
                           TListView(TheKompo).Columns[1].Caption:=___ccc__0511__Size;
                           TListView(TheKompo).Columns[2].Caption:=___ccc__0515__User;
                           end;

                    0518 : begin  // icons help LV items
                           TListView(TheKompo).Items[0].Caption:=___ccc__0615__IconHLP_0;
                           TListView(TheKompo).Items[1].Caption:=___ccc__0616__IconHLP_1;
                           TListView(TheKompo).Items[2].Caption:=___ccc__0617__IconHLP_2;
                           TListView(TheKompo).Items[3].Caption:=___ccc__0618__IconHLP_3;
                           TListView(TheKompo).Items[4].Caption:=___ccc__0619__IconHLP_4;
                           TListView(TheKompo).Items[5].Caption:=___ccc__0620__IconHLP_5;
                           TListView(TheKompo).Items[6].Caption:=___ccc__0621__IconHLP_6;
                           TListView(TheKompo).Items[7].Caption:=___ccc__0622__IconHLP_7;
                           TListView(TheKompo).Items[8].Caption:=___ccc__0623__IconHLP_8;
                           TListView(TheKompo).Items[9].Caption:=___ccc__0624__IconHLP_9;
                           TListView(TheKompo).Items[10].Caption:=___ccc__0625__IconHLP_10;
                           TListView(TheKompo).Items[11].Caption:=___ccc__0626__IconHLP_11;
                           end;




                    0519 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0520 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0521 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0522 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0523 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0524 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0525 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0526 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));
                    0527 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0500__File));


                    0528 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0614__MaxComs));
                    0529 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0529__AutoAddComs));

                    ///--------- specials-------------------------------------------------end


                    0530 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0408__Help));
                    0531 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0531__WelcomeToExoSee));
                    0532 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0532__NicknameChars));
                    0533 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0533__SetUpShareFolder));
                    0534 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0534__Save));
                    0535 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0535__PersonalMessage));
                    0536 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0536__MsgWhenNotOnline4Chat));
                    0537 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0537__Remove));
                    0538 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0538__AddFolder));
                    0539 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0539__LocalSharedFolders));
                    0540 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0540__PubFoldersDescription));
                    0541 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0541__MaxTotalUploads));
                    0542 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0542__LocalPrivFolders));
                    0543 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0543__PrivFoldersDescription));
                    0544 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0544__XtraFoldersDescription));
                    0545 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0545__CanAccessPrivs));
                    0546 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0546__CanSendNoConfirm));
                    0547 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0547__HasXtraFolder));
                    0548 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0548__XtraFolder));
                    0549 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0549__ExoSeeSettings));
                    0550 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0550__EnableWebXOCLinks));
                    0551 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0551__BehindRouter));
                    0552 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0552__AutoRejectLans));
                    0553 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0553__ExpandSubFolders));
                    0554 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0554__MyDlFolder));
                    0555 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0555__ComsStart));
                   
                    0556 : begin
                           TControl(TheKompo).SetTextBuf(pchar(___ccc__0556__AddCom));
                           TControl(TheKompo).Hint:=___ccc__0506__DesAddCom;
                           end;
                    0557 : begin
                           TControl(TheKompo).SetTextBuf(pchar(___ccc__0557__DelCom));
                           TControl(TheKompo).Hint:=___ccc__0507__DesDelCom;
                           end;
                    0558 : begin
                           TControl(TheKompo).SetTextBuf(pchar(___ccc__0067__Properties));
                           TControl(TheKompo).Hint:=___ccc__0508__DesComProps;
                           end;
                    0559 : begin
                           TControl(TheKompo).SetTextBuf(pchar(___ccc__0559__UpdateList));
                           TControl(TheKompo).Hint:=___ccc__0509__DesPubComs;
                           end;

                    0560 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0560__Start));
                    0561 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0561__Search));
                    0562 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0562__Browse));
                    0563 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0563__AddXOC));
                    0564 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0564__Welcome1));
                    0565 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0565__ComLinks));
                    0566 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0566__DbRecords));
                    0567 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0558__Add));
                    0568 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0568__AddXocInfoToCom));
                    0569 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0567__Cancel)); // *.*
                    0570 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0570__Filename2));
                    0571 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0571__Size2));
                    0572 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0572__Category2));
                    0573 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0573__Description2));
                    0574 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0574__FileHttpURL));
                    0575 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0575__AddMyNick));
                    0576 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0576__Sent2));
                    0577 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0577__Read2));
                    0578 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0578__Speed));
                    0579 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0579__TimeLeft2));
                    0580 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0580__Progress2));
                    0581 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0581__RunFile));
                    0582 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0582__OpenFolder));
                    0583 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0583__FileSendTo));
                    0584 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0584__FileDownloadFrom));
                    0585 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0585__From2));
                    0586 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0586__DoYouAccept2));
                    0587 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0587__Accept));
                    0588 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0588__Deny));
                    0589 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0589__AutoDenyAfter));
                    0590 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0590__Rules2));
                    0591 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0591__LoginPassword2));
                    0592 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0592__AllowComWeb));
                    0593 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0593__AddedOn2));
                    0594 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0594__AddedBy2));
                    0595 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0595__XOCLink2));
                    0596 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0596__Download2));
                    0597 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0597__AddBR));
                    0598 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0598__AddDescTitle));
                    0599 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0599__Generate));
                    0600 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0072__Close));
                    0601 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0601__ContentType2));
                    0602 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0602__ServerName2));
                    0603 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0603__DownloadFolder2));
                    0604 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0604__Percent2));
                    0605 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0605__XOCDownload));
                    0606 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0606__DLsULs));
                    0607 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0607__CompletedDLs));
                    0608 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0526__Web));
                    0609 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0527__Forum));
                    0610 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0528__ChatBox));
                    0611 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0608__Des_Xoc1));
                    0612 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0609__Des_Xoc2));
                    0613 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0610__Des_Xoc3));
                    0614 : TControl(TheKompo).SetTextBuf(pchar(___ccc__0611__Des_Xoc4));


          end;


      end;


   end;


end;
end.





../delphi71code/exosee-code-source/uc_funcs-pas..