show_free_dlg
show_free_dlg
http://www.humanemulator.net/objects/WI ... ee_dlg.php
$xml – строка содержащая xml
где можно взять пример такой строки?
$xml – строка содержащая xml
где можно взять пример такой строки?
Re: show_free_dlg
Код: Выделить всё
<freeDlg x="10" y="10" width="500" height="500" value="app freedlg" >
<COMBOBOX x="10" y="10" width="100" height="20" value="ccc" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
</COMBOBOX>
<LISTBOX x="10" y="50" width="100" height="100" value="4" >
<VALUE>4</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
</LISTBOX>
<EDIT x="150" y="10" width="100" height="20" value="2000" ></EDIT>
<MULTIEDIT x="150" y="100" width="100" height="80" value="2000" ></MULTIEDIT>
<CHECKBOX x="150" y="50" width="100" height="20" value="0" ></CHECKBOX>
<LABLE x="150" y="80" width="100" height="20" value="lable" ></LABLE>
<TREE x="150" y="200" width="100" height="100" value="tree" >
<VALUE value="tree0">
<VALUE value="tree10"></VALUE>
<VALUE value="tree20"></VALUE>
<VALUE value="tree30"></VALUE>
</VALUE>
<VALUE value="tree1"></VALUE>
<VALUE value="tree2"></VALUE>
</TREE>
</freeDlg>
Код: Выделить всё
<?php
// The following code is required to properly run XWeb Human Emulator
require("../../../Templates/xweb_human_emulator.php");
// начало
echo "<hr><font color=blue>app->show_free_dlg</font><hr>";
// читаем файл
$xml = $textfile->read_file("2.xml",60) ;
// возвращаем в виде массива
echo $rez = $app->show_free_dlg($xml,false);
echo "<br>";
// возвращаем в виде XML
echo $rez = $app->show_free_dlg($xml);
// конец
echo "<hr><br>";
// Quit
$app->quit();
?>
Re: show_free_dlg
какие то баги с этим диалогом, кнопки OK CANCEL наползают на текст, часть элементов то появляется то исчезает, дошло до того что пришлось
if ($result == 'Not Runned') {
echo 'Please restart system';
$app->quit();
}
if ($result == 'Not Runned') {
echo 'Please restart system';
$app->quit();
}
Re: show_free_dlg
можно сюда кинуть xml-код проблемного диалога?
Re: show_free_dlg
Код: Выделить всё
<freeDlg x="50" y="200" width="749" height="320" value="set format" >
<LABLE x="10" y="80" width="96" height="40" value="select" ></LABLE>
<LISTBOX x="10" y="130" width="96" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="111" y="80" width="26" height="40" value="select" ></LABLE>
<LISTBOX x="111" y="130" width="26" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="142" y="80" width="26" height="40" value="select" ></LABLE>
<LISTBOX x="142" y="130" width="26" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="173" y="80" width="58" height="40" value="select" ></LABLE>
<LISTBOX x="173" y="130" width="58" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="236" y="80" width="32" height="40" value="select" ></LABLE>
<LISTBOX x="236" y="130" width="32" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="273" y="80" width="32" height="40" value="select" ></LABLE>
<LISTBOX x="273" y="130" width="32" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="310" y="80" width="32" height="40" value="select" ></LABLE>
<LISTBOX x="310" y="130" width="32" height="160" value="crap" >
</LISTBOX>
<LABLE x="347" y="80" width="38" height="40" value="select" ></LABLE>
<LISTBOX x="347" y="130" width="38" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="390" y="80" width="38" height="40" value="select" ></LABLE>
<LISTBOX x="390" y="130" width="38" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="433" y="80" width="64" height="40" value="select" ></LABLE>
<LISTBOX x="433" y="130" width="64" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="502" y="80" width="109" height="40" value="select" ></LABLE>
<LISTBOX x="502" y="130" width="109" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
<LABLE x="616" y="80" width="0" height="40" value="select" ></LABLE>
<LISTBOX x="616" y="130" width="0" height="160" value="crap" >
<VALUE>1</VALUE>
<VALUE>2</VALUE>
<VALUE>3</VALUE>
<VALUE>four</VALUE>
<VALUE>5</VALUE>
<VALUE>6</VALUE>
<VALUE>7</VALUE>
<VALUE>8</VALUE>
<VALUE>9</VALUE>
<VALUE>ten</VALUE>
</LISTBOX>
</freeDlg>
Работает крайне нестабильно - то выдает пустое окно Dialog Dynamic, то все нормально, то вобще
Код: Выделить всё
if ($result == 'Not Runned') {
echo 'Please restart system';
$app->quit();
}
Вопрос стоит так - или чинить, или мне переписывать кучу кода через вебинтерфейс так работать нельзя. Завтра попробую 4.1.1
Re: show_free_dlg
у меня выглядит ваш диалог вот так
- Вложения
-
- у меня выглядит ваш диалог вот так
- free_dlg.jpg (35.71 КБ) 619 просмотров
Re: show_free_dlg
попробуйте этот код, нужно поиграть полями в $str_, глючит по разному
Код: Выделить всё
define('BR',"");
$str_ = 'string1,ssssssssterrrr1,sssss,123666666666666123,123,1223123123,24334,123,reofijrewf,w45f';
$str = explode(',',$str_);
//var_dump($str);
// build dialog
// calculate width of dialog
$width_ = 5; $x = 5; $y = 0;
$multiplier = 8; //px per symbol
foreach ($str as $_pos => $_text) {
echo $_text;
$width_ = round($width_ + $multiplier * max_length($_text) + 15);
}
$xml = '<freeDlg x="50" y="200" width="' . $width_ . '" height="320" value="set format" >' . BR;
foreach ($str as $_pos => $_text) {
$size = round($multiplier * max_length($_text));
$x = $x + 5;
$xml .= ' <LABLE x="' . $x . '" y="80" width="' . $size . '" height="40" value="'.$_text.'" ></LABLE>' . BR;
$xml .= ' <LISTBOX x="' . $x . '" y="130" width="' . $size . '" height="160" value="crap" >' . BR;
$xml .= ' <VALUE>1</VALUE>' . BR;
$xml .= ' <VALUE>2</VALUE>' . BR;
$xml .= ' <VALUE>3</VALUE>' . BR;
$xml .= ' <VALUE>four</VALUE>' . BR;
$xml .= ' <VALUE>5</VALUE>' . BR;
$xml .= ' <VALUE>6</VALUE>' . BR;
$xml .= ' <VALUE>7</VALUE>' . BR;
$xml .= ' <VALUE>8</VALUE>' . BR;
$xml .= ' <VALUE>9</VALUE>' . BR;
$xml .= ' <VALUE>ten</VALUE>' . BR;
$xml .= ' </LISTBOX>' . BR;
$x = $x + $size;
}
$xml .= '</freeDlg>';
$result = $app->show_free_dlg($xml,false,$separator='|');
Re: show_free_dlg
немного пришлось изменить ваш код
strlen вместо max_length
результат:
strlen вместо max_length
Код: Выделить всё
define('BR',"");
$str_ = "string1,ssssssssterrrr1,sssss,123666666666666123,123,1223123123,24334,123,reofijrewf,w45f";
$str = explode(',',$str_);
//var_dump($str);
// build dialog
// calculate width of dialog
$width_ = 5; $x = 5; $y = 0;
$multiplier = 8; //px per symbol
foreach ($str as $_pos => $_text) {
//echo $_text;
$width_ = round($width_ + $multiplier * strlen($_text) + 15);
echo $width_ ;
}
$xml = '<freeDlg x="50" y="200" width="' . $width_ . '" height="320" value="set format" >' . BR;
foreach ($str as $_pos => $_text) {
$size = round($multiplier * strlen($_text));
$x = $x + 5;
$xml .= ' <LABLE x="' . $x . '" y="80" width="' . $size . '" height="40" value="'.$_text.'" ></LABLE>' . BR;
$xml .= ' <LISTBOX x="' . $x . '" y="130" width="' . $size . '" height="160" value="crap" >' . BR;
$xml .= ' <VALUE>1</VALUE>' . BR;
$xml .= ' <VALUE>2</VALUE>' . BR;
$xml .= ' <VALUE>3</VALUE>' . BR;
$xml .= ' <VALUE>four</VALUE>' . BR;
$xml .= ' <VALUE>5</VALUE>' . BR;
$xml .= ' <VALUE>6</VALUE>' . BR;
$xml .= ' <VALUE>7</VALUE>' . BR;
$xml .= ' <VALUE>8</VALUE>' . BR;
$xml .= ' <VALUE>9</VALUE>' . BR;
$xml .= ' <VALUE>ten</VALUE>' . BR;
$xml .= ' </LISTBOX>' . BR;
$x = $x + $size;
echo $x."<br>";
}
$xml .= '</freeDlg>';
$result = $app->show_free_dlg($xml,false,$separator='|');
- Вложения
-
- 2.jpg (35.46 КБ) 605 просмотров
Re: show_free_dlg
У меня глюк стабильно появляется если полей <VALUE></VALUE> больше 10 (11 в форме).