* Bug #11069 fixed - An axe could be wrongly set as parent for an uicontrol.
+* Bug #11070 fixed - The "Visible"/"Enable"/"Position" properties of a frame
+ uicontrol did not impact its children.
+
* Bug #11203 fixed - Description for info output argument was wrong in lsqrsolve help page.
* Bug #11450 fixed - Logarithmic ticks were not sorted.
* Bug #11485 fixed - delete function kills reference to axes before use it.
-* Bug #11488 fixed - Due to browsevar, an error was displayed in the console when deleting
+* Bug #11488 fixed - Due to browsevar, an error was displayed in the console when deleting
a global var.
* Bug #11300 fixed - freson calculated wrong frequencies in Scilab 5.3.3.
package org.scilab.modules.gui.bridge.frame;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_CHILDREN__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_ENABLE__;
+
import java.awt.Component;
import javax.swing.JPanel;
+import org.scilab.modules.graphic_objects.graphicController.GraphicController;
+import org.scilab.modules.gui.SwingView;
import org.scilab.modules.gui.SwingViewObject;
import org.scilab.modules.gui.SwingViewWidget;
import org.scilab.modules.gui.bridge.canvas.SwingScilabCanvas;
public void update(String property, Object value) {
SwingViewWidget.update(this, property, value);
}
+
+ /**
+ * Set the enable status of the frame and its children
+ * @param status the status to set
+ */
+ public void setEnabled(boolean status) {
+ if (status) {
+ // Enable the frame
+ super.setEnabled(status);
+ // Enable its children according to their __GO_UI_ENABLE__ property
+ String[] children = (String[]) GraphicController.getController().getProperty(uid, __GO_CHILDREN__);
+ for (int kChild = 0; kChild < children.length; kChild++) {
+ Boolean childStatus = (Boolean) GraphicController.getController().getProperty(children[kChild], __GO_UI_ENABLE__);
+ SwingView.getFromId(children[kChild]).update(__GO_UI_ENABLE__, childStatus);
+ }
+ } else {
+ // Disable the frame
+ super.setEnabled(status);
+ // Disable its children
+ Component[] components = getComponents();
+ for (int compIndex = 0; compIndex < components.length; compIndex++) {
+ components[compIndex].setEnabled(false);
+ }
+ }
+ }
}
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Vincent COUVERT
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- Non-regression test for bug 11070 -->
+// <-- TEST WITH GRAPHIC -->
+// <-- INTERACTIVE TEST -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/11070
+//
+// <-- Short Description -->
+// The "Visible"/"Enable"/"Position" properties of a frame uicontrol did not impact its children.
+
+// 1 - Copy/paste the following lines into Scilab
+fig = scf(0);
+frameH = uicontrol( ...
+ "parent" , fig,...
+ "style" , "frame",...
+ "string" , "test",...
+ "units" , "pixels",...
+ "position" , [0 0 200 200],...
+ "background" , [1 1 1]*0.8);
+editH = uicontrol( ...
+ "parent" , frameH,...
+ "style" , "edit",...
+ "string" , "test",...
+ "units" , "pixels",...
+ "position" , [100 100 60 40],...
+ "fontunits" , "points",...
+ "fontsize" , 24,...
+ "background" , [1 1 1]*0.8);
+// Check that the frame and the edit are visible & enabled
+
+// 2 - Copy/paste the following line into Scilab
+frameH.enable = "off";
+// Check that the frame and the edit are visible & disabled
+
+// 3 - Copy/paste the following line into Scilab
+frameH.enable = "on";
+// Check that the frame and the edit are visible & enabled
+
+// 4 - Copy/paste the following lines into Scilab
+editH.enable = "off";
+frameH.enable = "off";
+frameH.enable = "on";
+// Check that the frame is visible and enable
+// Check that the edit is visible & disabled
+
+// 5 - Copy/paste the following lines into Scilab
+editH.enable = "on";
+// Check that the frame and the edit are visible & enabled
+
+// 6 - Copy/paste the following line into Scilab
+frameH.visible = "off";
+// Check that the frame and the edit are invisible
+
+// 3 - Copy/paste the following line into Scilab
+frameH.visible = "on";
+// Check that the frame and the edit are visible & enabled
+
+// 4 - Copy/paste the following lines into Scilab
+editH.visible = "off";
+frameH.visible = "off";
+frameH.visible = "on";
+// Check that the frame is visible and enable
+// Check that the edit is invisible
+
+// 5 - Copy/paste the following lines into Scilab
+editH.visible = "on";
+// Check that the frame and the edit are visible & enabled
+
+// 6 - Copy/paste the following lines into Scilab
+frameH.position(1) = 200;
+// Check that the frame position has changed and that the edit position has been updated
\ No newline at end of file