From 68afcaea99fbda6af7c7fd28369b8800585c1901 Mon Sep 17 00:00:00 2001 From: Vincent COUVERT Date: Tue, 21 Jul 2009 14:35:41 +0200 Subject: [PATCH] figure position set using [x y w h] now set the axes_size instead of figure size --- scilab/RELEASE_NOTES_5.2.X | 10 ++++++++++ scilab/modules/gui/help/en_US/figure.xml | 7 ++++--- .../modules/gui/src/cpp/SetUicontrolPosition.cpp | 9 ++++++++- .../modules/gui/src/cpp/SetUicontrolPosition.hxx | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 scilab/RELEASE_NOTES_5.2.X diff --git a/scilab/RELEASE_NOTES_5.2.X b/scilab/RELEASE_NOTES_5.2.X new file mode 100644 index 0000000..51a7326 --- /dev/null +++ b/scilab/RELEASE_NOTES_5.2.X @@ -0,0 +1,10 @@ + Scilab 5.2 Release_Notes + ======================== + +Known incompatibilities: + +- Fonction "figure": when setting the size of the figure using the "Position" + property with a matrix such as [x y width height], the values of width and + height no more set the window size itself but the size of the virtual graphics + window (the part of the figure which contains uicontrols and graphics) as if + the user sets the axes_size property of a figure. diff --git a/scilab/modules/gui/help/en_US/figure.xml b/scilab/modules/gui/help/en_US/figure.xml index bf911dd..c6a8572 100644 --- a/scilab/modules/gui/help/en_US/figure.xml +++ b/scilab/modules/gui/help/en_US/figure.xml @@ -81,10 +81,11 @@ Position - allows to control the geometrical aspect of the control. + allows to control the geometrical aspect of the figure. It is a [1,4] real vector [x y width height] where the letters stand for the x - location of the left bottom corner, the y location of the left bottom - corner, the width and the height of the uicontrol. + location of the top left corner, the y location of the top left corner, the width and the height of the virtual graphics window + (the part of the figure which contains uicontrols and graphics). + See the axes_size property description in figure properties help page. One can also set this property by giving a string where the fields are separated by a "|", ie "x|y|width|height". diff --git a/scilab/modules/gui/src/cpp/SetUicontrolPosition.cpp b/scilab/modules/gui/src/cpp/SetUicontrolPosition.cpp index daff735..6210248 100644 --- a/scilab/modules/gui/src/cpp/SetUicontrolPosition.cpp +++ b/scilab/modules/gui/src/cpp/SetUicontrolPosition.cpp @@ -29,6 +29,8 @@ int SetUicontrolPosition(sciPointObj* sciObj, size_t stackPointer, int valueType int * returnValues = NULL; sciPointObj *parent = NULL; + + int status = 0; if (stackPointer == -1) /* Default values setting */ { @@ -104,7 +106,12 @@ int SetUicontrolPosition(sciPointObj* sciObj, size_t stackPointer, int valueType } else if( sciGetEntityType(sciObj) == SCI_FIGURE ) /* Uicontrol figure */ { - return (int)(sciInitScreenPosition(sciObj, xInt, yInt) & sciSetWindowDim(sciObj, widthInt, heightInt)); + /* disable protection since this function will call Java */ + disableFigureSynchronization(sciObj); + status = sciSetDimension(sciObj, widthInt, heightInt) ; + enableFigureSynchronization(sciObj); + return (int)(sciInitScreenPosition(sciObj, xInt, yInt) & status); + //return (int)(sciInitScreenPosition(sciObj, xInt, yInt) & sciSetWindowDim(sciObj, widthInt, heightInt)); } else /* All other uicontrol styles */ { diff --git a/scilab/modules/gui/src/cpp/SetUicontrolPosition.hxx b/scilab/modules/gui/src/cpp/SetUicontrolPosition.hxx index 2e11dea..2ba9960 100644 --- a/scilab/modules/gui/src/cpp/SetUicontrolPosition.hxx +++ b/scilab/modules/gui/src/cpp/SetUicontrolPosition.hxx @@ -28,6 +28,7 @@ extern "C" #include "SetPropertyStatus.h" #include "UicontrolStyleToString.h" #include "HandleManagement.h" +#include "GraphicSynchronizerInterface.h" } #endif /* __SET_UICONTROL_POSITION_HXX__ */ -- 1.7.9.5