=== modified file 'src/com/goldencode/p2j/ui/MenuWidget.java'
--- src/com/goldencode/p2j/ui/MenuWidget.java	2015-09-07 10:24:13 +0000
+++ src/com/goldencode/p2j/ui/MenuWidget.java	2015-11-23 07:48:49 +0000
@@ -14,6 +14,7 @@
 **                  added initialization code.
 ** 003 VIG 20150501 Implemented CommonHandleTree interface.
 ** 004 VIG 20150823 Fixed firstChild and lastChild methods.
+** 005 VIG 20151123 Added setVisible methods showing the "not setable" error.
 */
 
 package com.goldencode.p2j.ui;
@@ -130,6 +131,34 @@
    }
    
    /**
+    * Set the VISIBLE writable attribute.
+    *
+    * @param    visible
+    *           The new value for the VISIBLE attribute.
+    */
+   @Override
+   public void setVisible(logical visible)
+   {
+      String name = dynamic().getValue() ? "widget" : name().getValue();
+      ErrorManager.recordOrShowError(4052, 
+               "VISIBLE is not a setable attribute for MENU " + name, false);
+   }
+
+   /**
+    * Set the VISIBLE writable attribute.
+    *
+    * @param    visible
+    *           The new value for the VISIBLE attribute.
+    */
+   @Override
+   public void setVisible(boolean visible)
+   {
+      String name = dynamic().getValue() ? "widget" : name().getValue();
+      ErrorManager.recordOrShowError(4052, 
+               "VISIBLE is not a setable attribute for MENU " + name, false);
+   }
+
+   /**
     * Finds menu-item in this menu tree. It can appear on different levels.
     * Menu-item is searched using some sort of depth-first algorithm.
     * See {@link #findMenuItemInt(String)}

=== modified file 'src/com/goldencode/p2j/ui/chui/ThinClient.java'
--- src/com/goldencode/p2j/ui/chui/ThinClient.java	2015-11-18 09:37:15 +0000
+++ src/com/goldencode/p2j/ui/chui/ThinClient.java	2015-11-24 16:29:34 +0000
@@ -2184,6 +2184,7 @@
 **                           marked as HIDDEN, do not show the window.
 **                           More fixes related to working with HIDDEN frame/widgets and resolving  
 **                           the window when nested frames are viewed directly.
+**     VIG 20151118          Fixed MENUBAR repaint for dynamic case.
 */
 
 package com.goldencode.p2j.ui.chui;
@@ -10661,13 +10662,14 @@
          }
 
          wnd.getMenubar().setVisible(true);
+         wnd.doLayout();
          
          eventDrawingBracket(wnd, new Runnable()
          {
             @Override
             public void run()
             {
-               wnd.getMenubar().repaint();               
+               wnd.repaint();               
             }
          });
       }

=== modified file 'src/com/goldencode/p2j/ui/client/Menu.java'
--- src/com/goldencode/p2j/ui/client/Menu.java	2015-10-30 07:32:16 +0000
+++ src/com/goldencode/p2j/ui/client/Menu.java	2015-11-24 16:32:57 +0000
@@ -16,7 +16,8 @@
 ** 004 VIG 20150618 Moved setVisible method from ChUI implementation.
 ** 005 VIG 20150905 Fixed event processing. 
 ** 006 VIG 20151027 Changed isMenubarElement to return false instead of throwing exception
-**                  in cases when specified component is not MenuItem or SubMenu. 
+**                  in cases when specified component is not MenuItem or SubMenu.
+** 007 VIG 20151124 Fixed showPopupMenu and hasFocus.  
 */
 
 package com.goldencode.p2j.ui.client;
@@ -83,15 +84,15 @@
    @SuppressWarnings({ "unchecked", "rawtypes" })
    public static void showPopupMenu(Menu<?> menu, Widget<?> src)
    {
+      Window wnd = (Window) src.ancestor();
       if (menu.parent() == null)
       {
-         ((Window) src.ancestor()).getContentPane().add(menu);
+         wnd.getContentPane().add(menu);
       }
 
       if (!menu.isVisible())
       {
          menu.setVisible(true);
-         menu.firstFocus();
       }
 
       menu.repaint();
@@ -270,11 +271,7 @@
    {
       if (config.popupOnly && config.visible)
       {
-         Widget<?> owner = screen().getRegistry().getComponent(config.ownerId);
-         return (owner == null || 
-                (owner instanceof Container && ((Container<?>)owner).focus() != this)) ? 
-                false : owner.hasFocus();
-         
+         return true;
       }
       
       return super.hasFocus();

=== modified file 'src/com/goldencode/p2j/ui/client/Window.java'
--- src/com/goldencode/p2j/ui/client/Window.java	2015-11-12 20:41:26 +0000
+++ src/com/goldencode/p2j/ui/client/Window.java	2015-11-24 16:34:29 +0000
@@ -243,6 +243,10 @@
 **     CA  20151106          A fix for HIDDEN attribute: distinguish between HIDE statement and 
 **                           setting the HIDDEN attribute to true.
 **     HC  20151112          Implemented THREE-D runtime support.
+**     VIG 20151123          Fixed afterConfigUpdate: added menu reset case and support of dynamic
+**                           menu assigning: make menubar visible if window is already visible.
+**                           Added currentFocus override: if opened pop-up menu exists in the
+**                           content pane - get current focused widget from it. 
 */
 
 package com.goldencode.p2j.ui.client;
@@ -1080,6 +1084,29 @@
    }
    
    /**
+    * Get widget which is in focus. If some pop-up menu is opened 
+    * than get the current focused widget from it.
+    *
+    * @return  focused widget.
+    * 
+    * @throws  IllegalStateException
+    *          If currentPopupMenu is set, but not visible.
+    */
+   @Override
+   public Widget<O> currentFocus()
+   {
+      for(Widget<O> w : getContentPane().widgets())
+      {
+         if (w instanceof Menu && ((Menu<O>) w).config().popupOnly && w.isVisible())
+         {
+            return ((Menu<O>) w).currentFocus();
+         }
+      }
+      
+      return super.currentFocus();
+   }
+   
+   /**
     * A window's "window" is itself.
     * 
     * @return   This window instance.
@@ -2254,16 +2281,14 @@
       {
          menubar = (Menu<O>) this.screen().getRegistry().getComponent(config.menubarId);
          
-         if (menubar != null)
+         if (menubar != null && menubar.parent() == null)
          {
-            if (menubar.parent() == null)
-            {
-               getContentPane().add(menubar);
-            }
+            getContentPane().add(menubar);
          }
          
-         // We must set MENUBAR visible only after check if enabled frames are exist.
-         if (ThinClient.getInstance().isChui())
+         // We must set MENUBAR visible only after check if enabled frames are exist a start
+         // or if this window already realized to support dynamic MENUBAR assigning in trigger.
+         if (isVisible())
          {
             menubar.setVisible(true);
          }
@@ -2273,6 +2298,11 @@
 
       if (config.menubarId == 0 && beforeUpdate.menubarId != 0)
       {
+         if (menubar != null)
+         {
+            getContentPane().remove(menubar);
+         }
+         
          menubar = null;
          
          layout = true;

=== modified file 'src/com/goldencode/p2j/ui/client/gui/SubMenuGuiImpl.java'
--- src/com/goldencode/p2j/ui/client/gui/SubMenuGuiImpl.java	2015-11-12 16:04:40 +0000
+++ src/com/goldencode/p2j/ui/client/gui/SubMenuGuiImpl.java	2015-11-24 11:42:59 +0000
@@ -21,6 +21,7 @@
 **                  handle processing to modal windows.
 ** 006 CA  20151026 Enclose driver API calls in select/releaseWindow().
 **     VIG 20151027 Added "pressed" state transferring to neighbor MENUBAR element.
+**                  Added mouseEntered=false to hideBody(..) and fixed javadoc.
 */
 
 package com.goldencode.p2j.ui.client.gui;
@@ -592,6 +593,7 @@
       parent().repaint();
 
       setSubmenusPressed(false, true);
+      mouseEntered = false;
       
       super.hideBody(recursive);
       
@@ -1137,6 +1139,8 @@
     * 
     * @param   pressed
     *          <code>true</code> means pressed, <code>false</code - means not pressed.
+    * @param   recursive
+    *          <code>true</code> denotes recursive processing of nested sub-menus. 
     */
    protected void setSubmenusPressed(boolean pressed, boolean recursive)
    {

=== modified file 'src/com/goldencode/p2j/ui/client/gui/WindowLayout.java'
--- src/com/goldencode/p2j/ui/client/gui/WindowLayout.java	2015-10-29 08:28:52 +0000
+++ src/com/goldencode/p2j/ui/client/gui/WindowLayout.java	2015-11-23 08:00:40 +0000
@@ -45,6 +45,7 @@
 ** 025 HC  20151027 Implemented WINDOW MESSAGE-AREA and STATUS-AREA attributes.
 **     CA  20151029 If workspace is resized, ensure the new window dimension includes the 
 **                  decorations and the border.
+** 026 VIG 20151122 Added isVisible check for menubar layout.
 */
 
 package com.goldencode.p2j.ui.client.gui;
@@ -232,7 +233,7 @@
          if (window instanceof Window)
          {
             Menu<?> menubar = ((Window<?>) window).getMenubar();
-            if (menubar != null)
+            if (menubar != null && menubar.isVisible())
             {
                menubar.doLayout();
                mbarHeight = c.heightToNative(menubar.height());
@@ -301,7 +302,7 @@
       if (window instanceof WindowGuiImpl)
       {
          Menu<GuiOutputManager> menubar = ((WindowGuiImpl)window).getMenubar();
-         if (menubar != null)
+         if (menubar != null && menubar.isVisible())
          {
             MenuConfig mc = menubar.config();
             menubar.setPhysicalLocation(x, y);

