• EN
    РУ

windowinterface/get_child_count

get_child_count(); - данная функция используется для получения числа дочерних окон.

После отработки функция возвращает результат своей работы в робот :
  • число дочерних окон – число окон, дочерних к данному.




  • Пример использования get_child_count (PHP):

    <?php $xhe_host = "127.0.0.1:7025";
     
    // подключим объект для управления эмулятором, если еще не подключен
    if (!isset($path))
      $path="../../../Templates/init.php";
    require($path);
     
    // начало
    echo "<hr><font color=blue>windowinterface->".basename (__FILE__)."</font><hr>";
     
    // 1 
    echo "1. Получим число дочерних окон XHE 1 уровня: ";
    echo $window->get_by_text("Human",false)->get_child_count();
     
    // 2
    echo "\n2. Получим число дочерних окон XHE : ";
    echo $window->get_by_text("Human",false)->get_child_count(true);
     
    // конец
    echo "<hr><br>";
     
    // Quit
    $app->quit();
    ?>

    Пример использования get_child_count (C#):

    #region using
     
    using System;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Text;
    using System.Threading;
     
    using XHE;
    using XHE.XHE_DOM;
    using XHE.XHE_System;
    using XHE.XHE_Window;
    using XHE.XHE_Web;
     
    #endregion
     
     class Program:XHEScript
     {
    	  static void Main(string[] args)
    	  {
    			// init XHE
    			server="127.0.0.1:7010";
    			InitXHE();
     
    			// начало
    			echo("<hr><font color=blue>windowinterface.get_child_count</font><hr>");
     
    			// 1 шаг
    			echo("1. Получим число дочерних окон XHE : ");
    			echo(window.get_by_text("Human").get_child_count(true));
     
    			// конец
    			echo("<hr><br>");
     
    			app.quit();            
    	  }
    }

    Пример использования get_child_count (Python):

    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
     
    xhe_host = "127.0.0.1:7010"
    from xweb_human_emulator import *
     
    # начало
    echo("<hr><font color=blue>windowinterface.xxxxxxxxx</font><hr>")
     
    # 1 
    echo("1. Получим число дочерних окон XHE : ")
    echo(window.get_by_text("XWeb").get_child_count())
     
    # конец
    echo("<hr><br>")
     
    # Quit
    app.quit()

    Пример использования get_child_count (JS):

    // подключим объект для управления эмулятором, если еще не подключен
    xhe_host="127.0.0.1:7010";
    echo=require("../../../Templates JS/init.js");
     
    // начало
    echo("<hr><font color=blue>windowinterface.get_child_count</font><hr>");
     
    // 1 шаг
    echo("1. Получим число дочерних окон XHE : ");
    echo(window.get_by_text("XWeb").get_child_count());
     
    // конец
    echo("<hr><br>");
     
    // Quit
    app.quit();