Permalink
Browse files

New "Hidden" style for application main menu

  • Loading branch information...
tvannini committed Nov 19, 2018
1 parent 5e30381 commit 9328f7349aa2aa1e7b04ec4150999453cb788419
@@ -11,6 +11,29 @@
border-bottom: 1px solid #cccccc;
}
.o2menuBarV {
background-color: #e0ddd9;
border-right: 1px solid #cccccc;
top: 0;
left: 0;
height: 100%;
border-bottom: 22px solid transparent;
overflow-x: none;
overflow-y: auto;
}
.o2menuBarH {
background-color: #e0ddd9;
border-right: 1px solid #cccccc;
top: 0;
left: 0;
height: 100%;
border-bottom: 22px solid transparent;
padding-top: 30px;
overflow-x: none;
overflow-y: auto;
}
.o2menu {
background-color: #f5f4f2;
border: 1px solid #cccccc;
@@ -20,6 +43,34 @@
border-top-right-radius: 3px;
}
.o2menuButton {
width: 50px;
height: 24px;
top: 1px;
left: 26px;
border: 1px solid #cccccc;
border-radius: 3px;
background-image: url(menu/btn.png);
background-color: #f5f4f2;
background-position: center;
background-repeat: no-repeat;
cursor: pointer;
}
.o2menuClose {
width: 50px;
height: 24px;
top: 1px;
left: 24px;
border: 1px solid #cccccc;
border-radius: 3px;
background-image: url(menu/close.png);
background-color: #ffffff;
background-position: center;
background-repeat: no-repeat;
cursor: pointer;
}
.o2menuFloat {
border-top-color: #cccccc;
}
@@ -39,6 +90,15 @@
cursor: pointer;
}
.o2menuBarV .o2menuItem,
.o2menuBarH .o2menuItem {
border: none;
border-right: 1px solid #e0ddd9;
padding: 6px 4px 6px 4px;
display: block;
cursor: pointer;
}
.o2menuItemOn {
background-color: #cccccc;
border-bottom: none;
@@ -58,32 +118,33 @@
cursor: pointer;
}
.o2menuBarV .o2menuItemOn,
.o2menuBarH .o2menuItemOn {
background-color: #f5f4f2;
border: none;
border-right: 1px solid #f5f4f2;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
padding: 6px 4px 6px 4px;
display: block;
cursor: pointer;
}
.o2menuImg {
padding-left: 5px;
display: inline;
}
.o2menuImg IMG {
vertical-align: text-bottom;
}
.o2menuBar .o2menuImg {
display: inline;
}
.o2menuLabel {
color: #444444;
white-space: nowrap;
padding: 0 5px 0 3px;
}
.o2menuBar .o2menuLabel {
display: inline;
}
.o2menuBar .o2menuItem .o2menuLabel {
color: #444444;
display: inline;
}
.o2menuItem .o2menuArrow {
background-image: url(menu/arrow.gif);
background-position: right;
Binary file not shown.
Binary file not shown.
@@ -21,11 +21,51 @@
overflow-y: auto;
}
.o2menuBarH {
background-color: #e8eef7;
border-right: 1px solid #a7bde4;
top: 0;
left: 0;
height: 100%;
border-bottom: 22px solid transparent;
padding-top: 30px;
overflow-x: none;
overflow-y: auto;
}
.o2menu {
background-color: #e8eef7;
border: 1px solid #a7bde4;
}
.o2menuButton {
width: 50px;
height: 24px;
top: 1px;
left: 24px;
border: 1px solid #a7bde4;
border-radius: 3px;
background-image: url(menu/btn.png);
background-color: #ffffff;
background-position: center;
background-repeat: no-repeat;
cursor: pointer;
}
.o2menuClose {
width: 50px;
height: 24px;
top: 1px;
left: 24px;
border: 1px solid #a7bde4;
border-radius: 3px;
background-image: url(menu/close.png);
background-color: #ffffff;
background-position: center;
background-repeat: no-repeat;
cursor: pointer;
}
.o2menuItem {
border: 1px solid #e8eef7;
padding: 0;
@@ -44,7 +84,7 @@
cursor: pointer;
}
.o2menuBarV .o2menuItem {
.o2menuBarV .o2menuItem, .o2menuBarH .o2menuItem {
border: 1px solid transparent;
border-top: 1px solid transparent;
border-bottom: 1px solid transparent;
@@ -72,7 +112,7 @@
cursor: pointer;
}
.o2menuBarV .o2menuItemOn {
.o2menuBarV .o2menuItemOn, .o2menuBarH .o2menuItemOn {
background-color: #c0d0eb;
border: 1px solid #a7bde4;
border-right: 1px solid transparent;
Binary file not shown.
Binary file not shown.
@@ -8914,6 +8914,26 @@ o2jse.menu.addMenu = function(menuId, label) {
};
/**
* Show/hide menu bar when style is "Hide"
*
*/
o2jse.menu.menuBtn = function() {
menuBar = document.getElementById('jxMenuBar');
menuBtn = document.getElementById('jxMenuButton');
if (menuBar.style.display == 'none') {
menuBtn.className = 'o2menuClose';
menuBar.style.display = 'block';
}
else {
menuBtn.className = 'o2menuButton';
menuBar.style.display = 'none';
}
}
/**
* Event handler for onMouseOver events on menu bar items
*
@@ -738,10 +738,12 @@ class o2html {
static function menu_bar($o2ctrl_obj, $as_code = false) {
$app = $_SESSION['o2_app'];
$left = $app->menu_style == 'L';
$hide = $app->menu_style == 'H';
$left = $app->menu_style == 'L' || $hide;
$html = "<!-- menu start -->\n<div id=\"jxMenuBar\" class=\"o2menuBar".
($left ? 'V' : '').
"\" onMouseOut='o2jse.menu.closeByTime();' style='position:fixed;'>\n";
($hide ? 'H' : ($left ? 'V' : '')).
"\" onMouseOut='o2jse.menu.closeByTime();' style='position:fixed;".
($hide ? 'display:none;' : '')."'>\n";
$with_list = ($app->profiling == "M" || $app->profiling == "B");
foreach ($o2ctrl_obj->voci as $item) {
if ($item->tipo == "S") {
@@ -779,6 +781,26 @@ class o2html {
if (!$as_code) {
print $html;
}
if ($hide) {
$html.= o2html::menu_bar_button($as_code);
}
return $html;
}
/**
* Display button to show/hide menu bar
*
* @param boolean $as_code
*/
static function menu_bar_button($as_code = false) {
$html = '<div id="jxMenuButton" class="o2menuButton" style="position:fixed" '.
'onClick="o2jse.menu.menuBtn();">&nbsp;</div>';
if (!$as_code) {
print $html;
}
return $html;
}
@@ -1623,18 +1645,18 @@ class o2html {
// ____________________________________ Register window open in Full-AJAX mode ___
$app->open_wins[$o2form_obj->id_esecuzione][$o2form_obj->nome] =
array("V" => true, "A" => true);
$repos = "";
$repos = "";
$menu_v = $app->menu_attivo && $app->menu_style == 'L';
$menu_o = $app->menu_attivo && $app->menu_style == 'T';
// ___________________________________________________________ NOT linked form ___
if (!$o2form_obj->linkto) {
$div_name = $o2form_obj->nome."_".$o2form_obj->id_esecuzione;
// ______________________________________________________________ Position ___
$cli_w = $app->client_width;
$cli_h = $app->client_height;
$menu_v = $app->menu_attivo && $app->menu_style != 'T';
$menu_o = $app->menu_attivo && $app->menu_style == 'T';
$bar_w = ($menu_v ? $app->menu_width : 0);
$bar_h = ($menu_o ? $app->menu_height : 0);
$stb_h = $app->status_height;
$cli_w = $app->client_width;
$cli_h = $app->client_height;
$bar_w = ($menu_v ? $app->menu_width : 0);
$bar_h = ($menu_o ? $app->menu_height : 0);
$stb_h = $app->status_height;
// _______________ Repos is needed if client size informations are missing ___
if (!$cli_w || ($menu_o && !$bar_v) || ($menu_v && !$bar_w)) {
$repos = "<script> o2jse.win.needRepos('".$div_name."'); </script>\n";
@@ -1676,10 +1698,8 @@ class o2html {
}
// _______________________________________________________________ Linked form ___
else {
$bar_h = ($app->menu_attivo && $app->menu_style != 'L' ?
($app->menu_height ? $app->menu_height : 25) : 0);
$bar_w = ($app->menu_attivo && $app->menu_style == 'L' ?
($app->menu_width ? $app->menu_width : 100) : 0);
$bar_h = ($menu_o ? ($app->menu_height ? $app->menu_height : 25) : 0);
$bar_w = ($menu_v ? ($app->menu_width ? $app->menu_width : 100) : 0);
$parent_win = $prg->form[$o2form_obj->linkto];
// _____________________________________________________ Relative position ___
$align_buffer = "left:".($parent_win->absolute_x + $o2form_obj->x + $bar_w).
@@ -862,6 +862,10 @@ class o2_form {
$this->larghezza = $app->client_width - $app->menu_width;
$this->altezza = $app->client_height - $app->status_height;
}
elseif ($app->menu_style == 'H') {
$this->larghezza = $app->client_width;
$this->altezza = $app->client_height - $app->status_height;
}
else {
$this->larghezza = $app->client_width;
$this->altezza = $app->client_height -
@@ -722,10 +722,10 @@ $list = array(
"appval" => null,
"desc" => " *** Application main menu style ***\n\n".
"Default application main menu position.\n".
"Menu style can be [T]op or [L]eft.\n".
"Menu style can be [T]op, [L]eft or [H]idden.\n".
"Default style is [T]op.",
"default" => "Top",
"values" => array("Top", "Left")),
"values" => array("Top", "Left", "Hidden")),
"encoding" => array("rntval" => null,
"appval" => null,
"desc" => " *** Application encoding ***\n\n".

0 comments on commit 9328f73

Please sign in to comment.