diff options
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/test_toolbox.quit | 37 | ||||
-rwxr-xr-x | etc/test_toolbox.start | 65 | ||||
-rwxr-xr-x | etc/toolbox_skeleton_preferences.xml | 18 | ||||
-rwxr-xr-x | etc/toolbox_skeleton_preferences.xsl | 39 |
4 files changed, 159 insertions, 0 deletions
diff --git a/etc/test_toolbox.quit b/etc/test_toolbox.quit new file mode 100755 index 0000000..b2adc13 --- /dev/null +++ b/etc/test_toolbox.quit @@ -0,0 +1,37 @@ +// This file is released under the 3-clause BSD license. See COPYING-BSD. + +// Some specific hooks can be specify here when the module is unloaded. + +function quitModule() + + etc_tlbx = get_absolute_file_path("test_toolbox.quit"); + etc_tlbx = getshortpathname(etc_tlbx); + root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") ); + + //unlink libraries + [bOK, ilib] = c_link('skeleton_cpp'); + if bOK then + ulink(ilib); + end + + [bOK, ilib] = c_link('skeleton_c'); + if bOK then + ulink(ilib); + end + + [bOK, ilib] = c_link('skeleton_fortran'); + if bOK then + ulink(ilib); + end + + // Remove Preferences GUI + // ============================================================================= + if getscilabmode() == "STD" then + removeModulePreferences(root_tlbx); + end + +endfunction + + +quitModule(); +clear quitModule; diff --git a/etc/test_toolbox.start b/etc/test_toolbox.start new file mode 100755 index 0000000..10acf09 --- /dev/null +++ b/etc/test_toolbox.start @@ -0,0 +1,65 @@ +// Copyright (C) 2008 - INRIA +// Copyright (C) 2009 - DIGITEO + +// This file is released under the 3-clause BSD license. See COPYING-BSD. + +function test_toolboxlib = startModule() + + TOOLBOX_NAME = "test_toolbox"; + TOOLBOX_TITLE = "test_toolbox"; + + mprintf("Start " + TOOLBOX_TITLE + "\n"); + + if isdef("test_toolboxlib") then + warning("scilab_toolbox library is already loaded"); + return; + end + + etc_tlbx = get_absolute_file_path("test_toolbox.start"); + etc_tlbx = getshortpathname(etc_tlbx); + root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") ); + +//Load functions library +// ============================================================================= + mprintf("\tLoad macros\n"); + pathmacros = pathconvert( root_tlbx ) + "macros" + filesep(); + test_toolboxlib = lib(pathmacros); + +// load gateways and Java libraries +// ============================================================================= + verboseMode = ilib_verbose(); + ilib_verbose(0); + mprintf("\tLoad gateways\n"); + exec(pathconvert(root_tlbx+"/sci_gateway/loader_gateway.sce",%f)); + +// load localization + addlocalizationdomain(TOOLBOX_NAME, root_tlbx + "/locales"); + +// Load and add help chapter +// ============================================================================= + if or(getscilabmode() == ["NW";"STD"]) then + mprintf("\tLoad help\n"); + path_addchapter = pathconvert(root_tlbx+"/jar"); + if ( isdir(path_addchapter) <> [] ) then + add_help_chapter(TOOLBOX_NAME, path_addchapter, %F); + end + end + +// Load demos +// ============================================================================= +// if or(getscilabmode() == ["NW";"STD"]) then +// mprintf("\tLoad demos\n"); +// pathdemos = pathconvert(root_tlbx+"/demos/scilab_toolbox.dem.gateway.sce", %F, %T); +// add_demo(TOOLBOX_TITLE, pathdemos); +// end + +// Load Preferences GUI +// ============================================================================= + // if getscilabmode() == "STD" then + // addModulePreferences(TOOLBOX_TITLE, root_tlbx, etc_tlbx + "scilab_toolbox_preferences.xml"); +// end + +endfunction + +scilab_toolboxlib = startModule(); +clear startModule; // remove startModule on stack diff --git a/etc/toolbox_skeleton_preferences.xml b/etc/toolbox_skeleton_preferences.xml new file mode 100755 index 0000000..f4f08c0 --- /dev/null +++ b/etc/toolbox_skeleton_preferences.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<body> + <Form text="_d(toolbox_skeleton, Rectangle)"> + <Entry text="_d(toolbox_skeleton, My Title)" value="exemple"/> + <Select text="_d(toolbox_skeleton, Height)" value="18"> + <Option value="12"/> + <Option value="18"/> + <Option value="24"/> + </Select> + <Select text="_d(toolbox_skeleton, Width)" value="18"> + <Option value="12"/> + <Option value="18"/> + <Option value="24"/> + </Select> + <Color text="_d(toolbox_skeleton, Color)" value="#0000ff"/> + <Checkbox text="_d(toolbox_skeleton, Outline)" value="yes"/> + </Form> +</body> diff --git a/etc/toolbox_skeleton_preferences.xsl b/etc/toolbox_skeleton_preferences.xsl new file mode 100755 index 0000000..3d57d0d --- /dev/null +++ b/etc/toolbox_skeleton_preferences.xsl @@ -0,0 +1,39 @@ +<?xml version='1.0' encoding='utf-8'?> +<xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:import href="$SCI/modules/preferences/src/xslt/XCommon.xsl"/> + + <xsl:template match="toolbox_skeleton" mode="tooltip">Environment</xsl:template> + <xsl:template match="toolbox_skeleton"> + <VSpace height="25"/> + <Title text="Environment"> + <HBox> + Foo: + <xsl:call-template name="Select"> + <xsl:with-param name="among"> + <option foo="bar"/> + <option foo="barbar"/> + <option foo="barbarbar"/> + </xsl:with-param> + </xsl:call-template> + </HBox> + </Title> + </xsl:template> + + <xsl:template match="save"> + <VSpace height="25"/> + <Title text="Save"> + <HBox> + <Checkbox listener="ActionListener"> + <xsl:if test="@bar='true'"> + <xsl:attribute name="checked">checked</xsl:attribute> + </xsl:if> + <actionPerformed set="bar" value="true"> + <xsl:call-template name="context"/> + </actionPerformed> + </Checkbox> + Save: + </HBox> + </Title> + </xsl:template> +</xsl:stylesheet>
\ No newline at end of file |