=== 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/StatusLineImpl.java'
--- src/com/goldencode/p2j/ui/chui/StatusLineImpl.java	2014-11-20 19:41:40 +0000
+++ src/com/goldencode/p2j/ui/chui/StatusLineImpl.java	2015-11-23 07:50:21 +0000
@@ -21,6 +21,7 @@
 **                  the widget or at the caller. Refs #2254
 ** 007 CA  20141119 Refactored drawing code to enable multiple OS windows, for GUI support.  Misc
 **                  changes/fixes related to drawing on multiple windows.
+** 008 VIG 20151123 Added assign fix to take menubar into consideration.
 */
 
 package com.goldencode.p2j.ui.chui;
@@ -89,8 +90,11 @@
       window.getContentPane().add(this);
       
       Dimension screenSize = window.screenDimension();
+      double height = screenSize.height - 1;
+      if (window.getMenubar() != null)
+         height -= 1;
       
-      this.setLocation(0, screenSize.height - 1);
+      this.setLocation(0, height);
       
       this.setLength((int) screenSize.width - Window.INSERT_TEXT.length());
       this.setColor(Color.NORMAL);

=== 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-22 16:25:02 +0000
@@ -2184,10 +2184,13 @@
 **                           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          Prevent ENTRY raising and focus request for click of the button other 
+**                           than left button for all widgets.
 */
 
 package com.goldencode.p2j.ui.chui;
 
+import java.awt.event.MouseEvent;
 import java.io.*;
 import java.lang.reflect.*;
 import java.util.*;
@@ -10661,13 +10664,14 @@
          }
 
          wnd.getMenubar().setVisible(true);
+         wnd.doLayout();
          
          eventDrawingBracket(wnd, new Runnable()
          {
             @Override
             public void run()
             {
-               wnd.getMenubar().repaint();               
+               wnd.repaint();               
             }
          });
       }
@@ -15255,7 +15259,12 @@
              evtID == MouseEvt.MOUSE_RELEASED ||
              evtID == MouseEvt.MOUSE_CLICKED)
          {
-            maySwitchFocus = (mouseSource != null && evtID == MouseEvt.MOUSE_PRESSED);
+            // ENTRY event and focus request are sent only for a press of the left mouse button 
+            // FILL-IN: ENTRY is sent later, after pop-up menu is closed.
+            maySwitchFocus = (mouseSource != null && 
+                              evtID == MouseEvt.MOUSE_PRESSED && 
+                              evt.getEvent().getButton() == MouseEvent.BUTTON1);
+            
             Widget<?> focus = UiUtils.getCurrentFocus();
             
             if (focus != null && focus.isLeaveEventRequired((Widget) mouseSource, evt))

=== 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-23 07:57:06 +0000
@@ -243,6 +243,8 @@
 **     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.
 */
 
 package com.goldencode.p2j.ui.client;
@@ -2254,16 +2256,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 +2273,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/chui/MessageAreaImpl.java'
--- src/com/goldencode/p2j/ui/client/chui/MessageAreaImpl.java	2015-10-16 22:02:15 +0000
+++ src/com/goldencode/p2j/ui/client/chui/MessageAreaImpl.java	2015-11-23 07:50:53 +0000
@@ -30,6 +30,7 @@
 ** 012 CA  20151006 Changes to allow multi-window frame placement in GUI.
 ** 013 HC  20151013 Changes to extend GUI multi-window focus management and ACTIVE-WINDOW system
 **                  handle processing to modal windows.
+** 014 VIG 20151123 Added assign fix to take menubar into consideration.
 */
 
 package com.goldencode.p2j.ui.client.chui;
@@ -139,9 +140,12 @@
       Dimension screenSize = window.screenDimension();
       for (int i = 0; i < 2; i++)
       {
+         double height = screenSize.height - 3 + i;
+         if (window.getMenubar() != null)
+            height -= 1;
          StatusLine<ChuiOutputManager> line = messageLines.get(i);
          window.getContentPane().add(line);
-         line.setLocation(0, screenSize.height - 3 + i);
+         line.setLocation(0, height);
          line.setLength(screenSize.width);
       }
       

=== modified file 'src/com/goldencode/p2j/ui/client/chui/WindowChuiImpl.java'
--- src/com/goldencode/p2j/ui/client/chui/WindowChuiImpl.java	2015-10-23 10:29:14 +0000
+++ src/com/goldencode/p2j/ui/client/chui/WindowChuiImpl.java	2015-11-23 07:58:04 +0000
@@ -38,6 +38,7 @@
 ** 015 HC  20150831 Scrolling support overhaul.
 ** 016 CA  20150921 Added drawCaret().
 ** 017 VIG 20151020 Added contentPane vertical shift when the window contains MENUBAR.
+** 018 VIG 20151123 Fixed doLayout for dynamic attach/detach menubar.
 */
 
 package com.goldencode.p2j.ui.client.chui;
@@ -102,6 +103,7 @@
    public void doLayout()
    {
       super.doLayout();
+      
       if (menubar != null)
       {
          menubar.doLayout();
@@ -109,6 +111,13 @@
          // shift window content because the MENUBAR become visible.
          contentPane.setLocation(new Point(0, 1));
       }
+      else
+      {
+         contentPane.setLocation(new Point(0, 0));
+      }
+      
+      messageArea.attach(this);
+      statusLine.attach(this);
    }
    
    /**                                     

=== modified file 'src/com/goldencode/p2j/ui/client/gui/ButtonGuiImpl.java'
--- src/com/goldencode/p2j/ui/client/gui/ButtonGuiImpl.java	2015-11-17 13:58:23 +0000
+++ src/com/goldencode/p2j/ui/client/gui/ButtonGuiImpl.java	2015-11-18 18:36:21 +0000
@@ -60,6 +60,7 @@
 **                  Improve button paintings.  Fix for several image based buttons drawing, width
 **                  and height mismatch.  Some logic reordered and comments cleanup.  The images
 **                  used for buttons must have convert-3d-colors flag to be on.
+**     VIG 20151118 Added processing only left mouse button in mousePressed(..).
 */
 
 package com.goldencode.p2j.ui.client.gui;
@@ -1401,7 +1402,7 @@
    public void mousePressed(MouseEvent e)
    {
       // push button effect
-      if (isEnabled() && !pressed)
+      if (isEnabled() && !pressed && e.getButton() == MouseEvent.BUTTON1)
       {
          requestFocus();
          pressed = 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-20 07:32:26 +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);
+      this.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/ToggleBoxGuiImpl.java'
--- src/com/goldencode/p2j/ui/client/gui/ToggleBoxGuiImpl.java	2015-11-12 20:41:26 +0000
+++ src/com/goldencode/p2j/ui/client/gui/ToggleBoxGuiImpl.java	2015-11-18 18:39:27 +0000
@@ -26,6 +26,7 @@
 ** 010 VIG 20151023 Fixed disposition of the label and highlight rectangle relative to check-box 
 **                  and highlight rectangle coloring using XOR.
 **     HC  20151112 Implemented THREE-D runtime support.
+**     VIG 20151118 Added processing only left mouse button in mousePressed(..).
 */
 
 package com.goldencode.p2j.ui.client.gui;
@@ -56,11 +57,6 @@
    /** Checkbox width or length */
    private static int CHKBOX_WIDTH = 11;
    
-   /**
-    * Color which is XORed with background to draw current row highlighting (dotted rectangle).
-    */
-   private final static ColorRgb CURRENT_ROW_XOR_COLOR = new ColorRgb(192, 192, 192);
-   
    /** Color resolver */
    private GuiColorResolver gc;
 
@@ -356,18 +352,6 @@
    }
    
    /**
-    * Notification of a mouse dragged event occurred for this widget.  No-op by default.
-    * 
-    * @param    e
-    *           The mouse event.
-    */
-   @Override
-   public void mouseDragged(MouseEvent e)
-   {
-      // TODO implement disabling during dragging
-   }
-   
-   /**
     * Notification of a mouse pressed event occurred for this widget.
     * 
     * @param    e
@@ -376,12 +360,15 @@
    @Override
    public void mousePressed(MouseEvent e)
    {
-      boolean oldVal = pressed; 
-      pressed = true;
-      
-      if (!oldVal)
+      if (e.getButton() == MouseEvent.BUTTON1)
       {
-         repaint();
+         boolean oldVal = pressed; 
+         pressed = true;
+
+         if (!oldVal)
+         {
+            repaint();
+         }
       }
    }
 
@@ -394,12 +381,15 @@
    @Override
    public void mouseReleased(MouseEvent e)
    {
-      boolean oldVal = pressed; 
-      pressed = false;
-      
-      if (oldVal)
+      if (e.getButton() == MouseEvent.BUTTON1)
       {
-         repaint();
+         boolean oldVal = pressed; 
+         pressed = false;
+
+         if (oldVal)
+         {
+            repaint();
+         }
       }
    }
 
@@ -435,7 +425,6 @@
       return new int[]
       {
          MouseEvent.MOUSE_CLICKED, 
-         MouseEvent.MOUSE_DRAGGED, 
          MouseEvent.MOUSE_PRESSED,
          MouseEvent.MOUSE_RELEASED
       };

=== 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);

