Skip to content

Commit 85c0ee0

Browse files
committed
Merge branch 'origin/master'
2 parents 4b8592d + afd7a49 commit 85c0ee0

File tree

1,210 files changed

+24716
-4033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,210 files changed

+24716
-4033
lines changed

.github/workflows/git-ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Widgets Toolbox Continuous Integration
2+
3+
# Controls when the workflow will run.
4+
on: [push, workflow_dispatch]
5+
# Triggers the workflow on push or pull request events
6+
# This allows the workflow run to be run manually from the Actions tab in GitHub.
7+
8+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
9+
jobs:
10+
# Run the Toolbox tests.
11+
run-tests:
12+
# Define the job strategy.
13+
strategy:
14+
# Set up the job strategy matrix to define the different job configurations.
15+
matrix:
16+
# List of platforms on which to run the tests.
17+
platform: [windows-latest]
18+
19+
# List of MATLAB releases over which to run the tests.
20+
matlab-version: [R2023b, R2024a, R2024b]
21+
22+
# We don't define any startup options until we reach R2023b (handled separately below).
23+
# matlab-startup-options: [ '' ]
24+
25+
# Windows/Mac are supported from R2021a onwards. Ubuntu is supported from R2020b onwards.
26+
# Exclude the Windows job on R2020b.
27+
28+
# Specify the platform that the job will run on.
29+
runs-on: ${{ matrix.platform }}
30+
31+
# Don't fail the entire run if one job fails.
32+
continue-on-error: true
33+
34+
# Steps define a sequence of tasks to be executed as part of the job.
35+
steps:
36+
# Check out the repository under $GITHUB_WORKSPACE, so that the job can access it.
37+
- name: Check out the repository
38+
uses: actions/checkout@v4
39+
40+
# For Linux jobs, start a display server on the runner.
41+
- name: Start a display server for jobs running on Linux.
42+
if: ${{ matrix.platform == 'ubuntu-latest' }}
43+
run: |
44+
sudo apt-get install -y xvfb
45+
Xvfb :99 &
46+
echo "DISPLAY=:99" >> $GITHUB_ENV
47+
48+
# Set up MATLAB on the runner.
49+
- name: Set up MATLAB on the runner.
50+
uses: matlab-actions/setup-matlab@v2
51+
with:
52+
# The tests require only base MATLAB.
53+
products: MATLAB
54+
release: ${{ matrix.matlab-version }}
55+
56+
# Run the Toolbox tests.
57+
- name: Run the Toolbox tests.
58+
uses: matlab-actions/run-command@v2
59+
with:
60+
startup-options: ${{ matrix.matlab-startup-options }}
61+
command: openProject("WidgetsToolbox.prj"); [~,results] = runTestSuite(); failedTests = table(results([results.Failed])); disp(failedTests); results.assertSuccess();

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# Widgets Toolbox - MATLAB App Building Components
1+
# Widgets Toolbox - App Designer and Advanced App Components
22

3-
[![View Widgets Toolbox - MATLAB App Building Components on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/83328-widgets-toolbox-matlab-app-building-components)
3+
[![View Widgets Toolbox - App Designer and Advanced App Components on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/83328)
4+
[![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=mathworks/widgets-toolbox&project=WidgetsToolbox.prj)
45

5-
Additional app building components to efficiently develop advanced user interfaces in MATLAB
6+
Widgets Toolbox helps you efficiently develop advanced user interfaces in MATLAB and App Designer. Widgets combine existing control functionalities together into larger, reusable, common functionality to accelerate development of graphical user interfaces.
67

7-
8-
Widgets Toolbox helps you efficiently develop advanced user interfaces in MATLAB. Widgets combine existing control functionalities together into larger, reusable, common functionality to accelerate development of graphical user interfaces.
9-
10-
The toolbox provides additional UI controls and higher-level components that implement common building blocks needed in MATLAB apps. Components include:
8+
Components include:
119

1210
- Grid of buttons grouped together
1311
- List of checkboxes and labels grouped together
@@ -20,11 +18,18 @@ The toolbox provides additional UI controls and higher-level components that imp
2018
- Slider control linked to a numeric spinner and edit field
2119
- List of tasks with icons indicating status (pass, fail, running, complete, etc.)
2220
- Toolbar with advanced layout functionality that can appear like a toolstrip
21+
- Contextual pane that can switch contents (similar to card panel, tab panel, uitab)
22+
23+
Additional object-oriented code components provide enable you to work more efficiently developing advanced apps using a modular hand-code approach. You can use model-view-controller or a similar separated presentation architecture.
24+
25+
- Application superclasses for managing single or multiple session files
26+
- Preference management
27+
- Superclasses for model-view-controller implementation
2328

24-
This version of Widgets Toolbox is intended for NEW development of uifigure or App Designer apps starting from R2020b or newer releases.
29+
This version of Widgets Toolbox is intended for NEW development of uifigure or App Designer apps starting from R2021a or newer releases.
2530

2631
If you have an existing MATLAB app using Widgets Toolbox content developed prior to R2020b, you may also need "Widgets Toolbox (Compatibility Support)".
27-
https://www.mathworks.com/matlabcentral/fileexchange/66235-widgets-toolbox
32+
https://www.mathworks.com/matlabcentral/fileexchange/66235-widgets-toolbox-compatibility-support
2833
https://github.com/mathworks/widgets-toolbox-legacy
2934

3035
Planning a complex or business-critical app? MathWorks Consulting can advise you on design and architecture: https://www.mathworks.com/services/consulting/proven-solutions/software-development-with-matlab.html

buildfile.m

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
function plan = buildfile
2+
% Perform build, test, and package actions
3+
4+
% Copyright 2025 The MathWorks, Inc.
5+
6+
7+
% These tasks require R2023b or later
8+
if isMATLABReleaseOlderThan("R2023b")
9+
error("R2023b or later is required for build tools.")
10+
end
11+
12+
13+
% Prepare the build plan
14+
plan = buildplan(localfunctions);
15+
16+
% Clean task
17+
% plan("clean") = matlab.buildtool.tasks.CleanTask;
18+
19+
% Code issues task
20+
plan("check") = matlab.buildtool.tasks.CodeIssuesTask;
21+
plan("check").SourceFiles = fullfile(plan.RootFolder,"widgets");
22+
plan("check").WarningThreshold = 0;
23+
24+
% Test task
25+
plan("test") = matlab.buildtool.tasks.TestTask;
26+
plan("test").SourceFiles = fullfile(plan.RootFolder,"test");
27+
28+
% Package task
29+
plan("archive").Dependencies = ["check","test"];
30+
31+
% Set default tasks
32+
plan.DefaultTasks = ["check","test"];
33+
34+
end %function
35+
36+
37+
function archiveTask(context)
38+
% Package the mltbx file
39+
40+
% Get root
41+
rootFolder = context.Plan.RootFolder;
42+
43+
% Increment the last part of the version number in wtDeployVersion.txt
44+
% (Other changes require commenting this out and making manual edits)
45+
wt.deploy.incrementVersionNumber();
46+
47+
% Increment the last part of the version number in version.txt
48+
toolboxVersion = wt.deploy.readVersionNumber();
49+
50+
% Read in the package options
51+
opts = wt.deploy.getPackageOptions(rootFolder, toolboxVersion);
52+
53+
% Perform the packaging
54+
matlab.addons.toolbox.packageToolbox(opts);
55+
56+
% Open the release folder
57+
releaseFolder = fullfile(rootFolder,"release");
58+
winopen(releaseFolder);
59+
60+
end %function
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
function opts = getPackageOptions(projectRoot, toolboxVersion)
2+
% Returns the toolbox packaging options
3+
4+
% Copyright 2025 The MathWorks, Inc.
5+
6+
arguments %(Input)
7+
projectRoot (1,1) string {mustBeFolder}
8+
toolboxVersion (1,1) string
9+
end
10+
11+
% arguments (Output)
12+
% opts (1,1) matlab.addons.toolbox.ToolboxOptions
13+
% end
14+
15+
16+
%% Define paths
17+
18+
19+
% Get the root folder
20+
toolboxFolder = fullfile(projectRoot,"widgets");
21+
docFolder = fullfile(toolboxFolder,"doc");
22+
23+
% UUID for Widgets Toolbox 2.x on File Exchange
24+
identifier = "78895307-cc36-4970-8b66-0697da8f9352";
25+
26+
27+
%% Prepare options
28+
29+
opts = matlab.addons.toolbox.ToolboxOptions(toolboxFolder, identifier);
30+
31+
32+
%% Requirements
33+
34+
opts.MinimumMatlabRelease = "R2021a";
35+
36+
opts.MaximumMatlabRelease = "";
37+
38+
opts.SupportedPlatforms.Win64 = true;
39+
opts.SupportedPlatforms.Glnxa64 = true;
40+
opts.SupportedPlatforms.Maci64 = true;
41+
opts.SupportedPlatforms.MatlabOnline = true;
42+
43+
% opts.RequiredAddons
44+
45+
% opts.RequiredAdditionalSoftware
46+
47+
48+
%% Output
49+
50+
opts.ToolboxVersion = toolboxVersion;
51+
52+
outFileName = sprintf("Widgets Toolbox %s.mltbx", toolboxVersion);
53+
opts.OutputFile = fullfile(projectRoot,"release",outFileName);
54+
55+
56+
%% Define file contents / paths
57+
58+
% Toolbox file contents paths - This should be set automatically
59+
% opts.ToolboxFiles
60+
61+
% Folders to add to the MATLAB path
62+
relativePaths = [
63+
""
64+
"doc"
65+
"examples"
66+
"icons"
67+
];
68+
opts.ToolboxMatlabPath = fullfile(toolboxFolder, relativePaths);
69+
% opts.ToolboxMatlabPath = [
70+
% ""
71+
% "doc"
72+
% "examples"
73+
% "icons"
74+
% ];
75+
76+
% Java path for toolbox
77+
% opts.ToolboxJavaPath
78+
79+
% Files to add to the app gallery
80+
opts.AppGalleryFiles = [
81+
fullfile(toolboxFolder, "examples","WidgetsExampleApp.mlapp")
82+
];
83+
84+
% Path to the getting started guide
85+
opts.ToolboxGettingStartedGuide = fullfile(toolboxFolder,...
86+
"doc","GettingStarted.mlx");
87+
88+
89+
%% Remove doc files except GettingStarted.mlx
90+
91+
% Define patterns
92+
docFilePattern = docFolder + filesep + alphanumericsPattern + ".mlx";
93+
gsFileStr = fullfile(docFolder,"GettingStarted.mlx");
94+
95+
% Find matches
96+
isMatch = matches(opts.ToolboxFiles, docFilePattern) & ...
97+
~matches(opts.ToolboxFiles, gsFileStr);
98+
99+
% Remove the files
100+
opts.ToolboxFiles(isMatch) = [];
101+
102+
103+
%% Metadata
104+
opts.ToolboxName = "Widgets Toolbox - App Designer and Advanced App Components";
105+
106+
opts.Summary = "Additional app building components to efficiently " + ...
107+
"develop advanced user interfaces in MATLAB";
108+
109+
opts.Description = join([
110+
"Widgets Toolbox helps you efficiently develop advanced user interfaces in MATLAB and App Designer. Widgets combine existing control functionalities together into larger, reusable, common functionality to accelerate development of graphical user interfaces."
111+
""
112+
"Components include:"
113+
""
114+
" - Grid of buttons grouped together"
115+
" - List of checkboxes and labels grouped together"
116+
" - Color selector control"
117+
" - Date and time selector"
118+
" - File selection control, consisting of a label, edit field, and browse button"
119+
" - Listbox control combined with a label and a set of buttons for managing the list composition and ordering"
120+
" - Password field with hidden text"
121+
" - Progress bar indicator with time remaining and cancel button"
122+
" - Slider control group with labels and enable/disable checkboxes"
123+
" - Slider control linked to a numeric spinner and edit field"
124+
" - List of tasks with icons indicating status (pass, fail, running, complete, etc.)"
125+
" - Toolbar with advanced layout functionality that can appear like a toolstrip"
126+
" - Contextual pane that can switch contents (similar to card panel, tab panel, uitab)"
127+
""
128+
"Additional object-oriented code components provide enable you to work more efficiently developing advanced apps using a modular hand-code approach. You can use model-view-controller or a similar separated presentation architecture."
129+
""
130+
" - Application superclasses for managing single or multiple session files"
131+
" - Preference management"
132+
" - Superclasses for model-view-controller implementation"
133+
""
134+
"This version of Widgets Toolbox is intended for NEW development of uifigure or App Designer apps starting from R2021a or newer releases."
135+
""
136+
"If you have an existing MATLAB app using Widgets Toolbox 1.x content, you may also need 'Widgets Toolbox (Compatibility Support)'."
137+
"https://www.mathworks.com/matlabcentral/fileexchange/66235-widgets-toolbox"
138+
""
139+
"Planning a complex or business-critical app? MathWorks Consulting can advise you on design and architecture: https://www.mathworks.com/services/consulting/proven-solutions/software-development-with-matlab.html"
140+
], newline);
141+
142+
opts.AuthorName = "Robyn Jackey (MathWorks Consulting)";
143+
144+
opts.AuthorEmail = "";
145+
146+
opts.AuthorCompany = "MathWorks Consulting";
147+
148+
opts.ToolboxImageFile = fullfile(projectRoot,"deploy","wtLogo.png");
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
function versionStr = incrementVersionNumber()
2+
% Increments the build number in the version.txt
3+
% Copyright 2025 The MathWorks Inc.
4+
5+
% Read in the version info
6+
[~, versionParts, versionFile] = wt.deploy.readVersionNumber();
7+
8+
% Increment the build index in the version number
9+
numVersionParts = numel(versionParts);
10+
if numVersionParts < 2
11+
versionParts(2) = uint32(1);
12+
else
13+
versionParts(end) = versionParts(end) + uint32(1);
14+
end
15+
16+
% Format as string
17+
versionStr = join(string(versionParts),".");
18+
19+
% Update the version file
20+
writelines(versionStr, versionFile);

deploy/makeLogo.m renamed to deploy/+wt/+deploy/makeLogo.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,5 @@
138138
%% Save logo
139139

140140
drawnow
141-
exportapp(fig,'widgets_logo.png')
141+
exportapp(fig,'widgets_logo.png')
142+
% Copyright 2025 The MathWorks Inc.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
function publishLiveScriptToHtml(srcFiles,dstFolder)
2+
% Publish each *.mlx file from doc_input into doc as html
3+
% Copyright 2025 The MathWorks Inc.
4+
5+
arguments
6+
srcFiles (:,1) string {mustBeFile}
7+
dstFolder (1,1) string {mustBeFolder} = fullfile(pwd,"html_output")
8+
end
9+
10+
% Loop on source files
11+
for idx = 1:numel(srcFiles)
12+
13+
% Get thie current source file
14+
thisSrcFile = srcFiles(idx);
15+
[~,srcFileName,srcFileExt] = fileparts(thisSrcFile);
16+
17+
% Must be .mlx format. Otherwise skip it.
18+
if matches(srcFileExt,".mlx")
19+
20+
% Get the destination file
21+
thisDstFile = fullfile(dstFolder, srcFileName + ".html");
22+
23+
% Get the timestamp on both
24+
srcFileInfo = dir(thisSrcFile);
25+
dstFileInfo = dir(thisDstFile);
26+
27+
% If the output file does not already exist or is older, proceed
28+
if isempty(dstFileInfo) || dstFileInfo.datenum < srcFileInfo.datenum
29+
30+
% Display a message
31+
fprintf('Publishing %s\n', thisDstFile);
32+
33+
% Publish it
34+
% matlab.internal.liveeditor.openAndConvert(...
35+
% char(thisSrcFile), thisDstFile);
36+
export(thisSrcFile, thisDstFile)
37+
38+
end %if
39+
40+
end %if
41+
42+
end %for

0 commit comments

Comments
 (0)