Project

General

Profile

11294a_fix.patch

Hynek Cihlar, 10/06/2026 05:56 AM

Download (14 KB)

View differences:

new/src/com/goldencode/p2j/ui/ClientExports.java 2026-09-29 11:03:56 +0000
338 338
**                           instead of the encoded image bytes.
339 339
** 195 AL2 20260818          getSelectedRowIndex() returns Integer and reports a missing browse with
340 340
**                           null;  -1 is a valid row index after an indexed reposition.
341
** 196 HC  20260929          Removed 'moveToBatch()', no longer used. Refs #11294.
341 342
*/
342 343

  
343 344
/*
......
3556 3557
   public Boolean moveToTop(int id);
3557 3558

  
3558 3559
   /**
3559
    * Moves the widgets to the top or bottom according to their Z-order. This method is designed to
3560
    * efficiently reposition widgets and avoid a server–client round trip for each widget.
3561
    *
3562
    * @param   top
3563
    *          {@code true} to move the widgets to the top, {@code false} to move them to the bottom.
3564
    * @param   ids
3565
    *          The widget ids.
3566
    *
3567
    * @return  an array of {@link Boolean} values representing the result for each widget:
3568
    *          {@link Boolean#TRUE} if the move was successful, {@link Boolean#FALSE} if unsuccessful, or
3569
    *          {@code null} if no widget with the given id was found.
3570
    */
3571
   public Boolean[] moveToBatch(boolean top, int[] ids);
3572

  
3573
   /**
3574 3560
    * Move the widget to the Bottom in z-order
3575 3561
    * 
3576 3562
    * @param id
new/src/com/goldencode/p2j/ui/GenericFrame.java 2026-09-29 10:37:15 +0000
1034 1034
**         20260525          Skip the removeFromDeferredDefs call in destroy() for frames whose
1035 1035
**                           ScreenDefinition was never enqueued via deferPush.
1036 1036
** 405 TG  20260717          Added isClientRegistered.
1037
** 406 HC  20260929          setChildrenVisible no longer moves the hidden widgets to the top, the client
1038
**                           does it when they are realized after their frame. Refs #11294.
1037 1039
*/
1038 1040

  
1039 1041
/*
......
5697 5699
      }
5698 5700

  
5699 5701
      i = 0;
5700
      List<GenericWidget<?>> moveToTopWidgets = new ArrayList<>();
5701 5702
      for (GenericWidget<?> widget : widgets)
5702 5703
      {
5703
         // hidden widgets are not overridden by this
5704
         // hidden widgets are not overridden by this; the client moves them to the top when they
5705
         // are realized later than the frame
5704 5706
         if (isHidden[i++] && value)
5705 5707
         {
5706
            if (!(widget instanceof FrameWidget))
5707
            {
5708
               moveToTopWidgets.add(widget);
5709
            }
5710 5708
            continue;
5711 5709
         }
5712 5710

  
......
5717 5715

  
5718 5716
        widget.setAttr("visible", widget.config.visible, value, WidgetConfig::setVisible, widget.config);
5719 5717
      }
5720

  
5721
      moveToBatchWorker(true, moveToTopWidgets);
5722 5718
   }
5723 5719

  
5724 5720
   /**
......
12230 12226
   }
12231 12227

  
12232 12228
   /**
12233
    * Moves the given widgets to the top or bottom of their frames. Updates the client with the new
12234
    * configuration and synchronizes the state on the server.
12235
    *
12236
    * @param   top
12237
    *          {@code true} for moving to top, or {@code false} for bottom.
12238
    * @param   widgets
12239
    *          The widgets to be repositioned.
12240
    */
12241
   private void moveToBatchWorker(boolean top, List<GenericWidget<?>> widgets)
12242
   {
12243
      if (widgets == null || widgets.isEmpty())
12244
      {
12245
         return;
12246
      }
12247

  
12248
      int size = widgets.size();
12249
      int[] ids = new int[size];
12250
      for (int i = 0; i < size; i++)
12251
      {
12252
         ids[i] = widgets.get(i).getId();
12253
      }
12254

  
12255
      Boolean[] results = LogicalTerminal.moveToBatch(top, ids);
12256
      for (int i = 0; i < results.length; i++)
12257
      {
12258
         widgets.get(i).syncMoveToState(top, results[i]);
12259
      }
12260
   }
12261

  
12262
   /**
12263 12229
    * Converts a frame element array into a array of widgets.  Any nodes that
12264 12230
    * are assignment only result in a <code>null</code> entry in the array.
12265 12231
    *
new/src/com/goldencode/p2j/ui/GenericWidget.java 2026-09-29 10:49:19 +0000
395 395
** 181 CA  20260707          Ensure the browse columns are properly registered as widgets and also deleted 
396 396
**                           when the BROWSE get deleted.
397 397
** 182 RNC 20260629          An unknown HELP value should be passed downstream as null.
398
** 183 HC  20260929          VISIBLE = TRUE clears HIDDEN before it views the frame, so the widget is
399
**                           realized together with its frame. Refs #11294.
398 400
*/
399 401

  
400 402
/*
......
2760 2762
            // the direct frame is not visible, force a view on it
2761 2763
            if (!frame.getFrameWidget()._isVisible())
2762 2764
            {
2765
               if (config.hidden)
2766
               {
2767
                  // like 4GL, un-hide the widget before the frame is viewed, so an unrealized
2768
                  // frame realizes it together with the other widgets
2769
                  _setHidden(false);
2770
                  pushWidgetAttr("hidden", false);
2771
               }
2763 2772
               frame.view();
2764 2773
            }
2765 2774
            else
new/src/com/goldencode/p2j/ui/LogicalTerminal.java 2026-09-29 11:03:56 +0000
1151 1151
** 485 TG  20260707          Ensure that the parent frame gets pushed before child frame.
1152 1152
** 486 AL2 20260818          getSelectedRowIndex() returns Integer and reports a missing browse with
1153 1153
**                           null;  -1 is a valid row index after an indexed reposition.
1154
** 487 HC  20260929          Removed 'moveToBatch()', no longer used. Refs #11294.
1154 1155
*/
1155 1156

  
1156 1157
/*
......
19324 19325
   }
19325 19326

  
19326 19327
   /**
19327
    * Moves the widgets to the top or bottom according to their Z-order. This method is designed to
19328
    * efficiently reposition widgets and avoid a server–client round trip for each widget.
19329
    *
19330
    * @param   top
19331
    *          {@code true} to move the widgets to the top, {@code false} to move them to the bottom.
19332
    * @param   ids
19333
    *          The widget ids.
19334
    *
19335
    * @return  an array of {@link Boolean} values representing the result for each widget:
19336
    *          {@link Boolean#TRUE} if the move was successful, {@link Boolean#FALSE} if unsuccessful, or
19337
    *          {@code null} if no widget with the given id was found.
19338
    */
19339
   public static Boolean[] moveToBatch(boolean top, int[] ids)
19340
   {
19341
      return locate().clientCall().moveToBatch(top, ids);
19342
   }
19343

  
19344
   /**
19345 19328
    * Set the state of SESSION:IMMEDIATE-DISPLAY attribute.
19346 19329
    * 
19347 19330
    * @param   on
new/src/com/goldencode/p2j/ui/chui/ThinClient.java 2026-09-29 11:03:56 +0000
3228 3228
** 1100 RNC 20260713          Added the 'inactiveWindowScrolling' variable. Skip the SE_VALUE_CHANGED focus
3229 3229
**                            forcing quirk for the mouse wheel originated events when inactive window
3230 3230
**                            scrolling is enabled.
3231
** 1111 HC  20260929          Removed 'moveToBatch()', no longer used. Refs #11294.
3231 3232
*/
3232 3233

  
3233 3234
/*
......
27079 27080
   }
27080 27081

  
27081 27082
   /**
27082
    * Moves the widgets to the top or bottom according to their Z-order. This method is designed to
27083
    * efficiently reposition widgets and avoid a server–client round trip for each widget.
27084
    *
27085
    * @param   top
27086
    *          {@code true} to move the widgets to the top, {@code false} to move them to the bottom.
27087
    * @param   ids
27088
    *          The widget ids.
27089
    *
27090
    * @return  an array of {@link Boolean} values representing the result for each widget:
27091
    *          {@link Boolean#TRUE} if the move was successful, {@link Boolean#FALSE} if unsuccessful, or
27092
    *          {@code null} if no widget with the given id was found.
27093
    */
27094
   public Boolean[] moveToBatch(boolean top, int[] ids)
27095
   {
27096
      Boolean[] result = new Boolean[ids.length];
27097
      for (int i = 0; i < ids.length; i++)
27098
      {
27099
         result[i] = top ? moveToTop(ids[i]) : moveToBottom(ids[i]);
27100
      }
27101

  
27102
      return result;
27103
   }
27104

  
27105
   /**
27106 27083
    * Set the custom mouse pointer for a widget or reset to the default one
27107 27084
    *
27108 27085
    * @param id
new/src/com/goldencode/p2j/ui/client/Frame.java 2026-09-29 10:37:15 +0000
772 772
** 344 RNC 20260220          Avoid storing duplicate lambdas as remove listeners.
773 773
** 345 RNC 20260225          Added the 'getScrollPane()' method.
774 774
** 346 SB  20260706          Added 'isFramePane'.
775
** 347 HC  20260929          Widgets hidden when the frame is realized are moved to the top when they are
776
**                           realized later. A child frame shown while its parent is not realized keeps
777
**                           its z-order. Refs #11294.
775 778
*/
776 779

  
777 780
/*
......
898 901
   /** Saved frame pane dimension. */
899 902
   private Dimension savedPaneDim = null;
900 903

  
904
   /** Flag indicating that the frame is being realized. */
905
   private boolean realizing = false;
906

  
901 907
   /** Track dynamic down. */
902 908
   private boolean dynamicDown = false;
903 909

  
......
2882 2888
      
2883 2889
      return savedState;
2884 2890
   }
2885
   
2891

  
2892
   /**
2893
    * Check if the frame is being realized.
2894
    *
2895
    * @return   <code>true</code> while {@link #realizeFrame(boolean)} realizes the frame.
2896
    */
2897
   public boolean isRealizing()
2898
   {
2899
      return realizing;
2900
   }
2901

  
2886 2902
   /**
2887 2903
    * Realize the frame, only if it's not yet realized.
2888 2904
    * 
......
2927 2943
         }
2928 2944
         
2929 2945
         config().realized = true;
2946
         // widgets realized during the frame realization keep their original z-order
2947
         realizing = true;
2930 2948

  
2931 2949
         FrameConfig config = config();
2932 2950
         // 4GL bug, row/column affects the parent inner size
......
2964 2982
         // z-order is normalized after layout is done; layout needs to use the original widget order
2965 2983
         // regardless of their z-class
2966 2984
         this.getContentPane().normalizeZOrder();
2985

  
2986
         // widgets hidden now are realized later than the frame, so they are moved to the top of
2987
         // their siblings when realized
2988
         for (Widget<O> w : getContentPane().widgets())
2989
         {
2990
            if (w instanceof AbstractWidget)
2991
            {
2992
               ((AbstractWidget<O>) w).setRaiseOnRealize(w.hidden());
2993
            }
2994
         }
2995
         realizing = false;
2967 2996
      }
2968 2997

  
2969 2998
      // process pending tab item list
......
3087 3116
   {
3088 3117
      active = true;
3089 3118
      viewed = true;
3119

  
3120
      // a child frame shown while its parent frame is not realized is realized together with the
3121
      // parent frame, so it keeps its original z-order
3122
      Frame<O> parentFrame = parent(Frame.class);
3123
      if (parentFrame != null && !parentFrame.isRealized())
3124
      {
3125
         return;
3126
      }
3127

  
3090 3128
      /* ENABLE and DISPLAY WITH FRAME doesn't change its z-order */
3091 3129
      if (currentStatement == null ||
3092 3130
          (currentStatement != UIStatement.ENABLE && currentStatement != UIStatement.DISPLAY &&
new/src/com/goldencode/p2j/ui/client/widget/AbstractWidget.java 2026-09-29 10:37:15 +0000
264 264
**                  dragging has started.
265 265
** 118 RNC 20260402 Fixed javadoc warnings.
266 266
** 119 RNC 20260225 Overridden the 'getMouseWheelTarget()' method.
267
** 120 HC  20260929 A field-level widget realized after its frame is moved to the top of its siblings,
268
**                  instead of raising it on its first visible config change. Refs #11294.
267 269
*/
268 270

  
269 271
/*
......
376 378
   
377 379
   /** Widget visible flag. This field is needed only for instances without config. */
378 380
   private boolean visible = true;
381

  
382
   /**
383
    * Flag indicating that this widget is moved to the top of its siblings when it is realized
384
    * after its frame.  The frame clears it for the widgets realized together with the frame.
385
    */
386
   private boolean raiseOnRealize = true;
379 387
   
380 388
   /** Storage for focus listeners. */
381 389
   private ArrayList<FocusListener> focusListeners = new ArrayList<FocusListener>();
......
882 890
   }
883 891

  
884 892
   /**
893
    * Set the flag indicating that this widget is moved to the top of its siblings when it is
894
    * realized after its frame.
895
    *
896
    * @param    raiseOnRealize
897
    *           <code>true</code> to move the widget to the top when it is realized.
898
    */
899
   public void setRaiseOnRealize(boolean raiseOnRealize)
900
   {
901
      this.raiseOnRealize = raiseOnRealize;
902
   }
903

  
904
   /**
885 905
    * Hide widget.
886 906
    */
887 907
   @Override
......
2907 2927
            Frame container = parent(Frame.class);
2908 2928
            if (container != null)
2909 2929
            {
2930
               // a field-level widget realized after its frame goes on top of its siblings
2931
               if (raiseOnRealize                              &&
2932
                   parent() == container.getContentPane()      &&
2933
                   container.isRealized()                      &&
2934
                   !container.isRealizing())
2935
               {
2936
                  moveToTop();
2937
               }
2910 2938
               container.getContentPane().normalizeZOrder();
2911 2939
            }
2912 2940
            widgetRealized();
......
3408 3436
      }
3409 3437

  
3410 3438
      // if widget was not yet realized and we change from hidden to visible ensure it is on the top
3411
      // of paint sequence
3412
      if (!c.realized && c.visible && c.visible != beforeUpdate.visible)
3439
      // of paint sequence; field-level widgets are raised in _setVisible, when they are realized
3440
      // after their frame
3441
      if (!c.realized && c.visible && c.visible != beforeUpdate.visible && parent(Frame.class) == null)
3413 3442
      {
3414 3443
         moveToTop();
3415 3444
      }