x_message and x_message_modeless are now obsolete functions:
Vincent Couvert [Wed, 12 Mar 2008 15:21:39 +0000 (15:21 +0000)]
 - they call messagebox
 - they are macros and no more C functions

buttondialog is now an obsolete function:
 - it calls messagebox
 - it no more uses TK widgets

Warning messages will be added when the documentation for messagebox will be written and all Scilab calls to x_message will be replaced.

scilab/modules/gui/Makefile.am
scilab/modules/gui/Makefile.in
scilab/modules/gui/includes/gw_gui.h
scilab/modules/gui/macros/x_message.sci [new file with mode: 0644]
scilab/modules/gui/macros/x_message_modeless.sci [new file with mode: 0644]
scilab/modules/gui/sci_gateway/c/gw_gui.c
scilab/modules/gui/sci_gateway/c/sci_x_message.c [deleted file]
scilab/modules/gui/sci_gateway/c/sci_x_message_modeless.c [deleted file]
scilab/modules/gui/sci_gateway/gui_gateway.xml
scilab/modules/gui/src/c/gui.vcproj
scilab/modules/tclsci/macros/buttondialog.sci

index 3199da7..fe36e75 100644 (file)
@@ -99,7 +99,6 @@ src/jni/SwingScilabMenu.giws.xml \
 src/jni/UIElementMapper.giws.xml
 
 GATEWAY_C_SOURCES = sci_gateway/c/sci_x_choice.c \
-sci_gateway/c/sci_x_message_modeless.c \
 sci_gateway/c/gw_gui.c \
 sci_gateway/c/sci_x_mdialog.c \
 sci_gateway/c/sci_x_dialog.c \
@@ -107,7 +106,6 @@ sci_gateway/c/sci_raise_window.c \
 sci_gateway/c/sci_x_choose.c \
 sci_gateway/c/sci_x_choose_modeless.c \
 sci_gateway/c/sci_xgetfile.c \
-sci_gateway/c/sci_x_message.c \
 sci_gateway/c/sci_unsetmenu.c \
 sci_gateway/c/sci_delmenu.c \
 sci_gateway/c/sci_setmenu.c \
index a266d81..10d9469 100644 (file)
@@ -108,14 +108,13 @@ am__libscigui_la_SOURCES_DIST = src/nogui/nogui.c \
        src/c/setMainWindowTitle.c src/c/addmenu.c \
        src/c/CreateUIControl.c src/c/CreateUIContextMenu.c \
        src/c/UicontrolStyleToString.c src/c/messageboxoptions.c \
-       sci_gateway/c/sci_x_choice.c \
-       sci_gateway/c/sci_x_message_modeless.c sci_gateway/c/gw_gui.c \
+       sci_gateway/c/sci_x_choice.c sci_gateway/c/gw_gui.c \
        sci_gateway/c/sci_x_mdialog.c sci_gateway/c/sci_x_dialog.c \
        sci_gateway/c/sci_raise_window.c sci_gateway/c/sci_x_choose.c \
        sci_gateway/c/sci_x_choose_modeless.c \
-       sci_gateway/c/sci_xgetfile.c sci_gateway/c/sci_x_message.c \
-       sci_gateway/c/sci_unsetmenu.c sci_gateway/c/sci_delmenu.c \
-       sci_gateway/c/sci_setmenu.c sci_gateway/c/sci_getlookandfeel.c \
+       sci_gateway/c/sci_xgetfile.c sci_gateway/c/sci_unsetmenu.c \
+       sci_gateway/c/sci_delmenu.c sci_gateway/c/sci_setmenu.c \
+       sci_gateway/c/sci_getlookandfeel.c \
        sci_gateway/c/sci_getinstalledlookandfeels.c \
        sci_gateway/c/sci_setlookandfeel.c \
        sci_gateway/c/sci_ClipBoard.c sci_gateway/c/sci_toolbar.c \
@@ -183,14 +182,12 @@ am__libscigui_la_SOURCES_DIST = src/nogui/nogui.c \
 @GUI_TRUE@     libscigui_la-UicontrolStyleToString.lo \
 @GUI_TRUE@     libscigui_la-messageboxoptions.lo
 @GUI_TRUE@am__objects_2 = libscigui_la-sci_x_choice.lo \
-@GUI_TRUE@     libscigui_la-sci_x_message_modeless.lo \
 @GUI_TRUE@     libscigui_la-gw_gui.lo libscigui_la-sci_x_mdialog.lo \
 @GUI_TRUE@     libscigui_la-sci_x_dialog.lo \
 @GUI_TRUE@     libscigui_la-sci_raise_window.lo \
 @GUI_TRUE@     libscigui_la-sci_x_choose.lo \
 @GUI_TRUE@     libscigui_la-sci_x_choose_modeless.lo \
 @GUI_TRUE@     libscigui_la-sci_xgetfile.lo \
-@GUI_TRUE@     libscigui_la-sci_x_message.lo \
 @GUI_TRUE@     libscigui_la-sci_unsetmenu.lo \
 @GUI_TRUE@     libscigui_la-sci_delmenu.lo \
 @GUI_TRUE@     libscigui_la-sci_setmenu.lo \
@@ -638,7 +635,6 @@ JARMASK = *.jar
 @GUI_TRUE@src/jni/UIElementMapper.giws.xml
 
 @GUI_TRUE@GATEWAY_C_SOURCES = sci_gateway/c/sci_x_choice.c \
-@GUI_TRUE@sci_gateway/c/sci_x_message_modeless.c \
 @GUI_TRUE@sci_gateway/c/gw_gui.c \
 @GUI_TRUE@sci_gateway/c/sci_x_mdialog.c \
 @GUI_TRUE@sci_gateway/c/sci_x_dialog.c \
@@ -646,7 +642,6 @@ JARMASK = *.jar
 @GUI_TRUE@sci_gateway/c/sci_x_choose.c \
 @GUI_TRUE@sci_gateway/c/sci_x_choose_modeless.c \
 @GUI_TRUE@sci_gateway/c/sci_xgetfile.c \
-@GUI_TRUE@sci_gateway/c/sci_x_message.c \
 @GUI_TRUE@sci_gateway/c/sci_unsetmenu.c \
 @GUI_TRUE@sci_gateway/c/sci_delmenu.c \
 @GUI_TRUE@sci_gateway/c/sci_setmenu.c \
@@ -995,8 +990,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_la-sci_x_choose_modeless.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_la-sci_x_dialog.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_la-sci_x_mdialog.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_la-sci_x_message.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_la-sci_x_message_modeless.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_la-sci_xgetfile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_la-setMainWindowTitle.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscigui_la-setlookandfeel.Plo@am__quote@
@@ -1134,13 +1127,6 @@ libscigui_la-sci_x_choice.lo: sci_gateway/c/sci_x_choice.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(libscigui_la_CFLAGS) $(CFLAGS) -c -o libscigui_la-sci_x_choice.lo `test -f 'sci_gateway/c/sci_x_choice.c' || echo '$(srcdir)/'`sci_gateway/c/sci_x_choice.c
 
-libscigui_la-sci_x_message_modeless.lo: sci_gateway/c/sci_x_message_modeless.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(libscigui_la_CFLAGS) $(CFLAGS) -MT libscigui_la-sci_x_message_modeless.lo -MD -MP -MF $(DEPDIR)/libscigui_la-sci_x_message_modeless.Tpo -c -o libscigui_la-sci_x_message_modeless.lo `test -f 'sci_gateway/c/sci_x_message_modeless.c' || echo '$(srcdir)/'`sci_gateway/c/sci_x_message_modeless.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscigui_la-sci_x_message_modeless.Tpo $(DEPDIR)/libscigui_la-sci_x_message_modeless.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_x_message_modeless.c' object='libscigui_la-sci_x_message_modeless.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(libscigui_la_CFLAGS) $(CFLAGS) -c -o libscigui_la-sci_x_message_modeless.lo `test -f 'sci_gateway/c/sci_x_message_modeless.c' || echo '$(srcdir)/'`sci_gateway/c/sci_x_message_modeless.c
-
 libscigui_la-gw_gui.lo: sci_gateway/c/gw_gui.c
 @am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(libscigui_la_CFLAGS) $(CFLAGS) -MT libscigui_la-gw_gui.lo -MD -MP -MF $(DEPDIR)/libscigui_la-gw_gui.Tpo -c -o libscigui_la-gw_gui.lo `test -f 'sci_gateway/c/gw_gui.c' || echo '$(srcdir)/'`sci_gateway/c/gw_gui.c
 @am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscigui_la-gw_gui.Tpo $(DEPDIR)/libscigui_la-gw_gui.Plo
@@ -1190,13 +1176,6 @@ libscigui_la-sci_xgetfile.lo: sci_gateway/c/sci_xgetfile.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(libscigui_la_CFLAGS) $(CFLAGS) -c -o libscigui_la-sci_xgetfile.lo `test -f 'sci_gateway/c/sci_xgetfile.c' || echo '$(srcdir)/'`sci_gateway/c/sci_xgetfile.c
 
-libscigui_la-sci_x_message.lo: sci_gateway/c/sci_x_message.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(libscigui_la_CFLAGS) $(CFLAGS) -MT libscigui_la-sci_x_message.lo -MD -MP -MF $(DEPDIR)/libscigui_la-sci_x_message.Tpo -c -o libscigui_la-sci_x_message.lo `test -f 'sci_gateway/c/sci_x_message.c' || echo '$(srcdir)/'`sci_gateway/c/sci_x_message.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscigui_la-sci_x_message.Tpo $(DEPDIR)/libscigui_la-sci_x_message.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_x_message.c' object='libscigui_la-sci_x_message.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(libscigui_la_CFLAGS) $(CFLAGS) -c -o libscigui_la-sci_x_message.lo `test -f 'sci_gateway/c/sci_x_message.c' || echo '$(srcdir)/'`sci_gateway/c/sci_x_message.c
-
 libscigui_la-sci_unsetmenu.lo: sci_gateway/c/sci_unsetmenu.c
 @am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigui_la_CPPFLAGS) $(CPPFLAGS) $(libscigui_la_CFLAGS) $(CFLAGS) -MT libscigui_la-sci_unsetmenu.lo -MD -MP -MF $(DEPDIR)/libscigui_la-sci_unsetmenu.Tpo -c -o libscigui_la-sci_unsetmenu.lo `test -f 'sci_gateway/c/sci_unsetmenu.c' || echo '$(srcdir)/'`sci_gateway/c/sci_unsetmenu.c
 @am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscigui_la-sci_unsetmenu.Tpo $(DEPDIR)/libscigui_la-sci_unsetmenu.Plo
index d2ad308..07aa419 100644 (file)
@@ -19,7 +19,6 @@
 int gw_gui(void);
 /*--------------------------------------------------------------------------*/
 int C2F(sci_x_dialog) _PARAMS((char *fname,unsigned long fname_len));
-int C2F(sci_x_message) _PARAMS((char *fname,unsigned long fname_len));
 int C2F(sci_x_choose) _PARAMS((char *fname,unsigned long fname_len));
 int C2F(sci_x_mdialog) _PARAMS((char *fname,unsigned long fname_len));
 int C2F(sci_x_choice) _PARAMS((char *fname,unsigned long fname_len));
@@ -28,7 +27,6 @@ int sci_setmenu(char *fname,unsigned long fname_len);
 int sci_unsetmenu(char *fname,unsigned long fname_len);
 int C2F(sci_xgetfile) _PARAMS((char *fname,unsigned long fname_len));
 int sci_uigetdir(char *fname,unsigned long l);
-int C2F(sci_x_message_modeless) _PARAMS((char *fname,unsigned long fname_len));
 int C2F(sci_raise_window) _PARAMS(( char * fname, unsigned long fname_len )) ;
 int C2F(sci_getlookandfeel) _PARAMS(( char * fname, unsigned long fname_len )) ;
 int C2F(sci_getinstalledlookandfeels) _PARAMS(( char * fname, unsigned long fname_len )) ;
diff --git a/scilab/modules/gui/macros/x_message.sci b/scilab/modules/gui/macros/x_message.sci
new file mode 100644 (file)
index 0000000..9dd25d6
--- /dev/null
@@ -0,0 +1,26 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA - Vincent COUVERT
+// 
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at    
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// @OBSOLETE
+
+function varargout = x_message(msg, buttons)
+
+//warnobsolete("messagebox", "5.1");
+
+rhs = argn(2);
+
+if rhs==1
+  messagebox(msg, "modal");
+  varargout(1) = [];
+else
+  answ = messagebox(msg, "modal", buttons);
+  varargout(1) = answ;
+end
+
+endfunction
diff --git a/scilab/modules/gui/macros/x_message_modeless.sci b/scilab/modules/gui/macros/x_message_modeless.sci
new file mode 100644 (file)
index 0000000..90028bc
--- /dev/null
@@ -0,0 +1,26 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA - Vincent COUVERT
+// 
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at    
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+// @OBSOLETE
+
+function varargout = x_message_modeless(msg, buttons)
+
+//warnobsolete("messagebox", "5.1");
+
+rhs = argn(2);
+
+if rhs==1
+  messagebox(msg, "non-modal");
+  varargout(1) = [];
+else
+  answ = messagebox(msg, "non-modal", buttons);
+  varargout(1) = answ;
+end
+
+endfunction
index 0277c92..73de00d 100644 (file)
@@ -22,7 +22,6 @@
 static gw_generic_table Tab[]=
 {
        {C2F(sci_x_dialog),"x_dialog"},
-       {C2F(sci_x_message),"x_message"},
        {C2F(sci_x_choose),"x_choose"},
        {C2F(sci_x_mdialog),"x_mdialog"},
        {C2F(sci_x_choice),"xchoicesi"},
@@ -30,7 +29,6 @@ static gw_generic_table Tab[]=
        {sci_setmenu,"setmenu"},
        {sci_unsetmenu,"unsetmenu"},
        {C2F(sci_xgetfile),"xgetfile"},
-       {C2F(sci_x_message_modeless),"x_message_modeless"},
        {C2F(sci_raise_window),"raise_window"},
        {C2F(sci_getlookandfeel),"getlookandfeel"},
        {C2F(sci_getinstalledlookandfeels),"getinstalledlookandfeels"},
diff --git a/scilab/modules/gui/sci_gateway/c/sci_x_message.c b/scilab/modules/gui/sci_gateway/c/sci_x_message.c
deleted file mode 100644 (file)
index 27ee825..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2008 - INRIA - Vincent COUVERT (java version)
- * 
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at    
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#include "gw_gui.h"
-#include "machine.h"
-#include "stack-c.h"
-#include "localization.h"
-#include "CallMessageBox.h"
-#include "Scierror.h"
-#include "getPropertyAssignedValue.h"
-/*--------------------------------------------------------------------------*/
-int C2F(sci_x_message) _PARAMS((char *fname,unsigned long fname_len))
-{
-  int nbRow = 0, nbCol = 0;
-
-  int messageBoxID = 0;
-
-  int buttonsTextAdr = 0;
-
-  int messageAdr = 0;
-
-  int buttonNumber = 0;
-  int buttonNumberAdr = 0;
-
-  CheckRhs(1,2);
-  CheckLhs(0,1);
-
-  if (VarType(1) == sci_strings)
-    {
-      GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &nbRow, &nbCol, &messageAdr);
-    }
-  else
-    {
-      Scierror(999, _("%s: Wrong type for first input argument: Single string expected.\n"), "x_message");
-      return FALSE;
-    }
-
-  /* Create the Java Object */
-  messageBoxID = createMessageBox();
-
-  /* Title is a default title */
-  setMessageBoxTitle(messageBoxID, _("Scilab Message"));
-  /* Message */
-  setMessageBoxMultiLineMessage(messageBoxID, getStringMatrixFromStack(messageAdr), nbCol*nbRow);
-    
-  if (Rhs == 2)
-    {
-      if (VarType(2) == sci_strings)
-        {
-          GetRhsVar(2,MATRIX_OF_STRING_DATATYPE,&nbRow,&nbCol,&buttonsTextAdr);
-          if ((nbCol*nbRow!=1) && (nbCol*nbRow!=2))
-            {
-              Scierror(999, _("%s: Wrong type for second input argument: one or two button names expected.\n"), "x_message");
-              return FALSE;
-            }
-        }
-      else
-        {
-          Scierror(999, _("%s: Wrong type for second input argument: one or two button names expected.\n"), "x_message");
-          return FALSE;
-        }
-
-      setMessageBoxButtonsLabels(messageBoxID, getStringMatrixFromStack(buttonsTextAdr), nbCol*nbRow);
-    }
-
-  /* Display it and wait for a user input */
-  messageBoxDisplayAndWait(messageBoxID);
-
-  if (Rhs==2 && (nbCol*nbRow==2)) /* If two buttons -> return the index of the button selected */
-    {
-      /* Read the user answer */
-      buttonNumber = getMessageBoxSelectedButton(messageBoxID);
-      
-      nbRow = 1; nbCol = 1;
-      CreateVar(Rhs+1, MATRIX_OF_DOUBLE_DATATYPE, &nbRow, &nbCol, &buttonNumberAdr);
-      *stk(buttonNumberAdr) = buttonNumber;
-      
-      LhsVar(1) = Rhs+1;
-      C2F(putlhsvar)();
-      
-      return TRUE;
-    }
-  else
-    {
-      LhsVar(1) = 0;
-      C2F(putlhsvar)();
-      return TRUE;
-    }
-
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/gui/sci_gateway/c/sci_x_message_modeless.c b/scilab/modules/gui/sci_gateway/c/sci_x_message_modeless.c
deleted file mode 100644 (file)
index 603136d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2008 - INRIA - Vincent COUVERT (java version)
- * 
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at    
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-#include "machine.h"
-#include "gw_gui.h"
-#include "stack-c.h"
-#include "localization.h"
-#include "CallMessageBox.h"
-#include "getPropertyAssignedValue.h" /* getStringMatrixFromStack */
-#include "Scierror.h"
-/*--------------------------------------------------------------------------*/
-int C2F(sci_x_message_modeless) _PARAMS((char *fname,unsigned long fname_len))
-{
-  int nbRow = 0, nbCol = 0;
-
-  int messageBoxID = 0;
-
-  int messageAdr = 0;
-
-  CheckRhs(1,2);
-  CheckLhs(0,1);
-
-  if (VarType(1) == sci_strings)
-    {
-      GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &nbRow, &nbCol, &messageAdr);
-    }
-  else
-    {
-      Scierror(999, _("%s: Wrong type for first input argument: Single string expected.\n"), "x_message_modeless");
-      return FALSE;
-    }
-
-  /* Create the Java Object */
-  messageBoxID = createMessageBox();
-
-  /* Title is a default title */
-  setMessageBoxTitle(messageBoxID, _("Scilab Message"));
-  /* Message */
-  setMessageBoxMultiLineMessage(messageBoxID, getStringMatrixFromStack(messageAdr), nbCol*nbRow);
-  /* Modality */
-  setMessageBoxModal(messageBoxID, FALSE);
-  /* Display it and wait for a user input */
-  messageBoxDisplayAndWait(messageBoxID);
-
-  LhsVar(1) = 0;
-  C2F(putlhsvar)();
-  return TRUE;
-
-}
-/*--------------------------------------------------------------------------*/
index 87c0cdc..b7cefa0 100644 (file)
 <!-- =================== -->
 
 <PRIMITIVE gatewayId="25" primitiveId="1" primitiveName="x_dialog" />
-<PRIMITIVE gatewayId="25" primitiveId="2" primitiveName="x_message" />
-<PRIMITIVE gatewayId="25" primitiveId="3" primitiveName="x_choose" />
-<PRIMITIVE gatewayId="25" primitiveId="4" primitiveName="x_mdialog" />
-<PRIMITIVE gatewayId="25" primitiveId="5" primitiveName="xchoicesi" />
-<PRIMITIVE gatewayId="25" primitiveId="6" primitiveName="delmenu" />
-<PRIMITIVE gatewayId="25" primitiveId="7" primitiveName="setmenu" />
-<PRIMITIVE gatewayId="25" primitiveId="8" primitiveName="unsetmenu" />
-<PRIMITIVE gatewayId="25" primitiveId="9" primitiveName="xgetfile" />
-<PRIMITIVE gatewayId="25" primitiveId="10" primitiveName="x_message_modeless" />
-<PRIMITIVE gatewayId="25" primitiveId="11" primitiveName="raise_window" />
-<PRIMITIVE gatewayId="25" primitiveId="12" primitiveName="getlookandfeel"/>
-<PRIMITIVE gatewayId="25" primitiveId="13" primitiveName="getinstalledlookandfeels"/>
-<PRIMITIVE gatewayId="25" primitiveId="14" primitiveName="setlookandfeel"/>
-<PRIMITIVE gatewayId="25" primitiveId="15" primitiveName="ClipBoard"/>
-<PRIMITIVE gatewayId="25" primitiveId="16" primitiveName="toolbar"/>
-<PRIMITIVE gatewayId="25" primitiveId="17" primitiveName="uigetdir"/>
-<PRIMITIVE gatewayId="25" primitiveId="18" primitiveName="uicontrol"/>
-<PRIMITIVE gatewayId="25" primitiveId="19" primitiveName="uimenu"/>
-<PRIMITIVE gatewayId="25" primitiveId="20" primitiveName="uipopup"/>
-<PRIMITIVE gatewayId="25" primitiveId="21" primitiveName="x_choose_modeless" />
-<PRIMITIVE gatewayId="25" primitiveId="22" primitiveName="uicontextmenu" />
-<PRIMITIVE gatewayId="25" primitiveId="23" primitiveName="uiwait" />
-<PRIMITIVE gatewayId="25" primitiveId="24" primitiveName="messagebox" />
+<PRIMITIVE gatewayId="25" primitiveId="2" primitiveName="x_choose" />
+<PRIMITIVE gatewayId="25" primitiveId="3" primitiveName="x_mdialog" />
+<PRIMITIVE gatewayId="25" primitiveId="4" primitiveName="xchoicesi" />
+<PRIMITIVE gatewayId="25" primitiveId="5" primitiveName="delmenu" />
+<PRIMITIVE gatewayId="25" primitiveId="6" primitiveName="setmenu" />
+<PRIMITIVE gatewayId="25" primitiveId="7" primitiveName="unsetmenu" />
+<PRIMITIVE gatewayId="25" primitiveId="8" primitiveName="xgetfile" />
+<PRIMITIVE gatewayId="25" primitiveId="9" primitiveName="raise_window" />
+<PRIMITIVE gatewayId="25" primitiveId="10" primitiveName="getlookandfeel"/>
+<PRIMITIVE gatewayId="25" primitiveId="11" primitiveName="getinstalledlookandfeels"/>
+<PRIMITIVE gatewayId="25" primitiveId="12" primitiveName="setlookandfeel"/>
+<PRIMITIVE gatewayId="25" primitiveId="13" primitiveName="ClipBoard"/>
+<PRIMITIVE gatewayId="25" primitiveId="14" primitiveName="toolbar"/>
+<PRIMITIVE gatewayId="25" primitiveId="15" primitiveName="uigetdir"/>
+<PRIMITIVE gatewayId="25" primitiveId="16" primitiveName="uicontrol"/>
+<PRIMITIVE gatewayId="25" primitiveId="17" primitiveName="uimenu"/>
+<PRIMITIVE gatewayId="25" primitiveId="18" primitiveName="uipopup"/>
+<PRIMITIVE gatewayId="25" primitiveId="19" primitiveName="x_choose_modeless" />
+<PRIMITIVE gatewayId="25" primitiveId="20" primitiveName="uicontextmenu" />
+<PRIMITIVE gatewayId="25" primitiveId="21" primitiveName="uiwait" />
+<PRIMITIVE gatewayId="25" primitiveId="22" primitiveName="messagebox" />
 </GATEWAY>
\ No newline at end of file
index 8dc0b28..2f2df76 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sci_gateway\c\sci_x_message.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\sci_gateway\c\sci_x_message_modeless.c"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\sci_gateway\c\sci_xgetfile.c"
                                >
                        </File>
index 6c3f1a5..55b83d7 100644 (file)
@@ -1,5 +1,5 @@
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2004 -  Jaime Urzua
+// Copyright (C) 2008 - INRIA - Vincent COUVERT
 // 
 // This file must be used under the terms of the CeCILL.
 // This source file is licensed as described in the file COPYING, which
@@ -7,48 +7,23 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
+// @OBSOLETE
 
-function answer=buttondialog(mes,bt,icon)
-// Button dialog 
-// This file is part of sciGUI toolbox
-// rev. 0.1
-//
-// This program is free software; you can redistribute it and/or modify
-//it under the terms of the GNU General Public License as published by
-//the Free Software Foundation; either version 2 of the License, or
-//(at your option) any later version.
-  
-  sciGUI_init()
-  //
-  rhs=argn(2);
-  doerror=%t;
-  answer=0;
-  if (rhs==0) then
-    mes=gettext('This is an example'),
-    bt="quit"
-    rhs=2;
-  end
-  if ((rhs==2)|(rhs==3)) then
-    locicon="scilab"
-    if ((rhs==3)&(type(icon)==10)) then
-      locicon=icon;
-    end
-    if ((type(mes)==10)&(type(bt)==10)) then
-      // do the work
-      TCL_EvalStr('set mybutdialoganswertmp [sciGUIButtonDialog -1 ""'+mes+'"" ""'+bt+'"" '+locicon+']');
-      while %t
-       realtimeinit(0.1);realtime(0);realtime(0.1);
-       TCL_EvalStr('set mybutdialogtmp [info exist mybutdialoganswertmp]');
-       if TCL_GetVar('mybutdialogtmp')=='1' then break,end;
-      end
-      answer=TCL_GetVar('mybutdialoganswertmp');
-      doerror=%f;
-    end
-  end
-
-  if doerror then
-    error(42);
-  end
+function answ=buttondialog(msg,btn,icon)
+
+//warnobsolete("messagebox", "5.1");
+
+rhs = argn(2);
+
+if rhs == 1 then
+  error(msprintf(gettext("%s: Wrong number of input arguments: 2 or 3 expected.\n"), "buttondialog"));
+elseif rhs == 2 then
+  answ = messagebox(msg, "modal", tokens(btn, "|"));
+else
+  answ = messagebox(msg, "modal", icon, tokens(btn, "|"));
+end
+
+answ = string(answ);
 
 endfunction