Permalink
Browse files

New controls "Flowbox" and "Frame"

  • Loading branch information...
tvannini committed Jan 2, 2019
1 parent 51cd106 commit 6f4e55c75ae60bd9a66a10cf78ae26e5b125428f
Showing with 397 additions and 3 deletions.
  1. +3 −1 htdocs/css/janox.css
  2. +31 −0 htdocs/css/janox/flowbox.css
  3. +1 −0 htdocs/css/sky.css
  4. +33 −0 htdocs/css/sky/flowbox.css
  5. +87 −2 lib/jxhtml.inc
  6. +82 −0 lib/jxjs.inc
  7. +160 −0 lib/jxui.inc
@@ -4,6 +4,7 @@
@import url(janox/form.css);
@import url(janox/button.css);
@import url(janox/multipg.css);
@import url(janox/flowbox.css);
@import url(janox/tools.css);
@import url(janox/table.css);
@import url(janox/nav.css);
@@ -260,7 +261,8 @@ option:hover {
}

.o2_ctrl_line {
border: 1px solid #cccccc;
border: none;
border-top: 1px solid #cccccc;
}

.o2_ctrl_img {
@@ -0,0 +1,31 @@
/* ============================ FLOWBOX= ============================ */
.o2_ctrl_box_out {
position: absolute;
border: 1px solid #cccccc;
border-radius: 5px;
background-color: #fcfbfa;
overflow: auto;
}

.o2_ctrl_box_in {
position: relative;
margin: 3px;
background-color: #f0efed;
float: left;
border: 1px solid #cccccc;
border-radius: 5px;
overflow: hidden;
}

.o2_ctrl_box_title {
width: 100%;
border-collapse: collapse;
}

.o2_ctrl_box_title th {
text-align: center;
font-weight: bold;
border-bottom: 1px solid #cccccc;
background-color: #e0ddd9;
height: 20px;
}
@@ -3,6 +3,7 @@
@import url(sky/form.css);
@import url(sky/button.css);
@import url(sky/multipg.css);
@import url(sky/flowbox.css);
@import url(sky/tools.css);
@import url(sky/table.css);
@import url(sky/nav.css);
@@ -0,0 +1,33 @@
/* ============================ FLOWBOX= ============================ */
.o2_ctrl_box_out {
position: absolute;
padding-bottom: 10px;
padding-right: 10px;
border: 1px solid #cccccc;
border-radius: 5px;
background-color: #e8eef7;
overflow: auto;
}

.o2_ctrl_box_in {
position: relative;
margin-top: 10px;
margin-left: 10px;
float: left;
overflow: hidden;
background-color: #f7f9fa;
border: 1px solid #a7bde4;
border-radius: 5px;
}

.o2_ctrl_box_title {
width: 100%;
border-collapse: collapse;
}

.o2_ctrl_box_title th {
text-align: center;
font-weight: bold;
background-color: #bccceb ;
height: 20px;
}
@@ -2650,8 +2650,93 @@ class o2html {
/**
* Creates HTML interface related to o2 control.
*
* @param o2_ctrl_multipage $o2ctrl_obj Related o2_ctrl_multipage object
* @param o2_ctrl_flowbox $o2ctrl_obj Related o2_ctrl_flowbox object
*/
static function ctrl_flowbox($o2ctrl_obj) {
$html_name = $o2ctrl_obj->nome.$o2ctrl_obj->id_esecuzione;
$o2ctrl_obj->pagine = count($o2ctrl_obj->label);
print '<div id="'.$html_name.'" class="'.$o2ctrl_obj->css.'" style="width:'.
$o2ctrl_obj->larghezza.'px;height:'.$o2ctrl_obj->altezza.'px;'.
($o2ctrl_obj->visibile ? "" : "display:none;")."\">\n";
$prg = $_SESSION['o2_app']->istanze_prg[$o2ctrl_obj->id_esecuzione];
$form = $prg->form[$o2ctrl_obj->form];
foreach ($form->controlli as &$singolo_ctrl) {
// ___________________________________________________ Controls in flowbox ___
if ($singolo_ctrl->padre == $o2ctrl_obj->nome) {
$singolo_ctrl->disegna();
}
}
print "</div>\n";
}
/**
* Creates HTML interface related to o2 control.
*
* @param o2_ctrl_frame $o2ctrl_obj Related o2_ctrl_frame object
*/
static function ctrl_frame($o2ctrl_obj) {
$html_name = $o2ctrl_obj->nome.$o2ctrl_obj->id_esecuzione;
$prg = $_SESSION['o2_app']->istanze_prg[$o2ctrl_obj->id_esecuzione];
$form = $prg->form[$o2ctrl_obj->form];
print '<div id="'.$html_name.'" class="'.$o2ctrl_obj->css.'" style="'.
($o2ctrl_obj->visibile ? "" : "display:none;")."\">\n";
print '<table class="o2_ctrl_box_title"><tr><th>'.
$form->controlli[$o2ctrl_obj->padre]->label[$o2ctrl_obj->info_padre[0]].
'</th></tr></table><div style="position:relative;width:'.
$o2ctrl_obj->larghezza.'px;height:'.$o2ctrl_obj->altezza.'px;">';
foreach ($form->controlli as &$singolo_ctrl) {
// ___________________________________________________ Controls in flowbox ___
if ($singolo_ctrl->padre == $o2ctrl_obj->nome) {
print '<div style="position:absolute;left:'.$singolo_ctrl->x.
'px;top:'.$singolo_ctrl->y.
"px;padding:0;margin:0;white-space:nowrap;\">\n";
if (!$o2ctrl_obj->modificabile) {
switch ($singolo_ctrl->tipo_ctrl) {
case "tab":
$singolo_ctrl->modificabile = false;
$singolo_ctrl->dis_by_parent = true;
foreach ($form->controlli as &$tmp_ctrl) {
if ($tmp_ctrl->tipo_ctrl == "navigator" &&
$tmp_ctrl->padre == $singolo_ctrl->nome) {
$tmp_ctrl->enable_del(false);
$tmp_ctrl->enable_detail(false);
$tmp_ctrl->enable_new(false);
$tmp_ctrl->enable_save(false);
$tmp_ctrl->enable_select(false);
$tmp_ctrl->enable_undo(false);
break;
}
}
break;
case "navigator":
$singolo_ctrl->enable_del(false);
$singolo_ctrl->enable_detail(false);
$singolo_ctrl->enable_new(false);
$singolo_ctrl->enable_save(false);
$singolo_ctrl->enable_select(false);
$singolo_ctrl->enable_undo(false);
break;
default:
$singolo_ctrl->modificabile = false;
break;
}
}
elseif ($singolo_ctrl->tipo_ctrl == "tab") {
$singolo_ctrl->dis_by_parent = false;
}
$singolo_ctrl->disegna();
print "</div>\n";
}
}
print "</div></div>\n";
}
static function ctrl_multipage($o2ctrl_obj) {
$html_name = $o2ctrl_obj->nome.$o2ctrl_obj->id_esecuzione;
@@ -2879,7 +2964,7 @@ class o2html {
$o2ctrl_obj->js_props($js_props ? $js_props : false).
" class='".$o2ctrl_obj->spazio_class.
($o2ctrl_obj->modificabile ? " jxtabedit" : "").
"' style='position:absolute;width:".$o2ctrl_obj->larghezza.
"' style='width:".$o2ctrl_obj->larghezza.
"px;height:".$o2ctrl_obj->altezza."px;".
($o2ctrl_obj->visibile ? "" : "display:none;")."'>\n";
// ______________________________________________________ Form input field ___
@@ -785,6 +785,88 @@ class jxjs {
}
/**
* Define flowbox control in full AJAX WEB 2.0 context
*
* @param o2_ctrl_flowbox $o2ctrl_obj Janox flowbox control object related to
* control
*/
static function ctrl_flowbox($o2ctrl_obj) {
$prg_local = $_SESSION['o2_app']->istanze_prg[$o2ctrl_obj->id_esecuzione];
$form_obj = $prg_local->form[$o2ctrl_obj->form];
foreach ($form_obj->controlli as &$singolo_ctrl) {
// ___________________________________________________ Controls in flowbox ___
if ($singolo_ctrl->padre == $o2ctrl_obj->nome) {
$singolo_ctrl->disegna();
}
}
// _________________________________________ Only first time HTML code is sent ___
print jxjs::ctrl($o2ctrl_obj,
'x:'.$o2ctrl_obj->x.
',y:'.$o2ctrl_obj->y.
',w:'.$o2ctrl_obj->larghezza.
',h:'.$o2ctrl_obj->altezza,
$o2ctrl_obj->js_props("", true));
}
/**
* Define frame control in full AJAX WEB 2.0 context
*
* @param o2_ctrl_frame $o2ctrl_obj Janox frame control object related to control
*/
static function ctrl_frame($o2ctrl_obj) {
$prg_local = $_SESSION['o2_app']->istanze_prg[$o2ctrl_obj->id_esecuzione];
$form_obj = $prg_local->form[$o2ctrl_obj->form];
foreach ($form_obj->controlli as &$singolo_ctrl) {
// _____________________________________________________ Controls in frame ___
if ($singolo_ctrl->padre == $o2ctrl_obj->nome) {
// ___________________________________________________ Read-only frame ___
if (!$o2ctrl_obj->modificabile) {
switch ($singolo_ctrl->tipo_ctrl) {
case "tab":
$singolo_ctrl->modificabile = false;
foreach ($form_obj->controlli as &$tmp_ctrl) {
if ($tmp_ctrl->tipo_ctrl == "navigator" &&
$tmp_ctrl->padre == $singolo_ctrl->nome) {
$tmp_ctrl->enable_del(false);
$tmp_ctrl->enable_detail(false);
$tmp_ctrl->enable_new(false);
$tmp_ctrl->enable_save(false);
$tmp_ctrl->enable_select(false);
$tmp_ctrl->enable_undo(false);
break;
}
}
break;
case "navigator":
$singolo_ctrl->enable_del(false);
$singolo_ctrl->enable_detail(false);
$singolo_ctrl->enable_new(false);
$singolo_ctrl->enable_save(false);
$singolo_ctrl->enable_select(false);
$singolo_ctrl->enable_undo(false);
break;
default:
$singolo_ctrl->modificabile = false;
break;
}
}
$singolo_ctrl->disegna();
}
}
// _________________________________________ Only first time HTML code is sent ___
print jxjs::ctrl($o2ctrl_obj,
'w:'.$o2ctrl_obj->larghezza.
',h:'.$o2ctrl_obj->altezza,
$o2ctrl_obj->js_props("", true));
}
/**
* Define area control in full AJAX WEB 2.0 context
*
Oops, something went wrong.

0 comments on commit 6f4e55c

Please sign in to comment.