summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent COUVERT <vincent.couvert@scilab-enterprises.com>2014-01-28 14:38:22 +0100
committerVincent COUVERT <vincent.couvert@scilab-enterprises.com>2014-01-31 14:54:10 +0100
commitad816a59326f3c6f19ff6f9c1c47415677c3a726 (patch)
tree4059f5a931691689a163df20450c8534d25a2654
parent249fd4f45b4328e48e58689a847e781b7c271dfd (diff)
downloadscilab-uiwidget.zip
scilab-uiwidget.tar.gz
* Bug #13185 fixed - When the "checked" option of an uimenu was set to "on" foruiwidget
the first time, the display order of others uimenus was changed. Change-Id: Ibe9ad74d7c1b630753fc1d7c4397e5a26130ca4f
-rw-r--r--scilab/CHANGES_5.5.X9
-rw-r--r--scilab/modules/core/includes/machine.h.in4
-rw-r--r--scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java3
-rw-r--r--scilab/modules/gui/tests/nonreg_tests/bug_13185.tst54
4 files changed, 66 insertions, 4 deletions
diff --git a/scilab/CHANGES_5.5.X b/scilab/CHANGES_5.5.X
index 9ec0683..169706b 100644
--- a/scilab/CHANGES_5.5.X
+++ b/scilab/CHANGES_5.5.X
@@ -330,6 +330,15 @@ Scilab Bug Fixes
330 330
331* Bug #13152 fixed - Typo fixed in syslin french help page. 331* Bug #13152 fixed - Typo fixed in syslin french help page.
332 332
333* Bug #13174 fixed - Scilab crashed after XML element removal.
334
335* Bug #13185 fixed - When the "checked" option of an uimenu was set to "on" for
336 the first time, the display order of others uimenus was changed.
337
338* Bug #13188 fixed - The output argument of eomday function was not pre-dimensioned.
339
340* Bug #13191 fixed - isempty(rational) returned an error message.
341
333 342
334Xcos Bug Fixes 343Xcos Bug Fixes
335============== 344==============
diff --git a/scilab/modules/core/includes/machine.h.in b/scilab/modules/core/includes/machine.h.in
index b11401b..fd5a145 100644
--- a/scilab/modules/core/includes/machine.h.in
+++ b/scilab/modules/core/includes/machine.h.in
@@ -58,11 +58,11 @@
58/* Define to 1 if you have the `bzero' function. */ 58/* Define to 1 if you have the `bzero' function. */
59#undef HAVE_BZERO 59#undef HAVE_BZERO
60 60
61/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the 61/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
62 CoreFoundation framework. */ 62 CoreFoundation framework. */
63#undef HAVE_CFLOCALECOPYCURRENT 63#undef HAVE_CFLOCALECOPYCURRENT
64 64
65/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in 65/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
66 the CoreFoundation framework. */ 66 the CoreFoundation framework. */
67#undef HAVE_CFPREFERENCESCOPYAPPVALUE 67#undef HAVE_CFPREFERENCESCOPYAPPVALUE
68 68
diff --git a/scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java b/scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java
index 7267b2b..1a71efd 100644
--- a/scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java
+++ b/scilab/modules/gui/src/java/org/scilab/modules/gui/SwingView.java
@@ -761,9 +761,8 @@ public final class SwingView implements GraphicView {
761 parent.add(meAsAMenuItem); 761 parent.add(meAsAMenuItem);
762 break; 762 break;
763 case UiChildMenu: 763 case UiChildMenu:
764 Integer parentId = (Integer) GraphicController.getController().getProperty(id, __GO_PARENT__);
765 SwingScilabMenuItem childMenu = (SwingScilabMenuItem) allObjects.get(id).getValue(); 764 SwingScilabMenuItem childMenu = (SwingScilabMenuItem) allObjects.get(id).getValue();
766 SwingScilabMenu parentMenu = (SwingScilabMenu) allObjects.get(parentId).getValue(); 765 JComponent parentMenu = (JComponent) childMenu.getParent();
767 766
768 int index = parentMenu.getComponentZOrder(childMenu); 767 int index = parentMenu.getComponentZOrder(childMenu);
769 parentMenu.remove(childMenu); 768 parentMenu.remove(childMenu);
diff --git a/scilab/modules/gui/tests/nonreg_tests/bug_13185.tst b/scilab/modules/gui/tests/nonreg_tests/bug_13185.tst
new file mode 100644
index 0000000..c86f373
--- /dev/null
+++ b/scilab/modules/gui/tests/nonreg_tests/bug_13185.tst
@@ -0,0 +1,54 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2014 - Scilab Enterprises - Vincent COUVERT
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- INTERACTIVE TEST -->
9//
10// <-- Non-regression test for bug 13185 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/13185
14//
15// <-- Short Description -->
16// When the "checked" option of an uimenu was set to "on" for
17// the first time, the display order of others uimenus was changed.
18
19function f_menu1()
20 obj = findobj("tag", "menu1");
21 if obj.checked == "on" then
22 obj.checked = "off";
23 else
24 obj.checked = "on";
25 end
26endfunction
27
28function f_menu2()
29 obj = findobj("tag", "menu2");
30 if obj.checked == "on" then
31 obj.checked = "off";
32 else
33 obj.checked = "on";
34 end
35endfunction
36
37function f_menu3()
38 obj = findobj("tag", "menu3");
39 if obj.checked == "on" then
40 obj.checked = "off";
41 else
42 obj.checked = "on";
43 end
44endfunction
45
46
47f = gcf()
48main_menu = uimenu(f, "label", "Test")
49menu_1 = uimenu(main_menu, "label", "menu1", "callback", "f_menu1()", "tag", "menu1")
50menu_2 = uimenu(main_menu, "label", "menu2", "callback", "f_menu2()", "tag", "menu2")
51menu_3 = uimenu(main_menu, "label", "menu3", "callback", "f_menu3()", "tag", "menu3")
52
53// First, you click on the first menu: "menu1". The menus list must not change.
54// Idem for "menu2" and "menu3"