Coder Social home page Coder Social logo

mathworks / widgets-toolbox Goto Github PK

View Code? Open in Web Editor NEW
30.0 8.0 11.0 8.52 MB

Additional app building components to efficiently develop advanced user interfaces in MATLAB

License: Other

MATLAB 65.24% HTML 34.76%
matlab toolbox widgets matlab-toolbox

widgets-toolbox's Introduction

Widgets Toolbox - MATLAB App Designer Components

View Widgets Toolbox - MATLAB App Designer Components on File Exchange Open in MATLAB Online

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.

Components include:

  • Grid of buttons grouped together
  • List of checkboxes and labels grouped together
  • Color selector control
  • File selection control, consisting of a label, edit field, and browse button
  • Listbox control combined with a label and a set of buttons for managing the list composition and ordering
  • Password field with hidden text
  • Progress bar indicator with time remaining and cancel button
  • Slider control group with labels and enable/disable checkboxes
  • Slider control linked to a numeric spinner and edit field
  • List of tasks with icons indicating status (pass, fail, running, complete, etc.)
  • Toolbar with advanced layout functionality that can appear like a toolstrip

This version of Widgets Toolbox is intended for NEW development of uifigure or App Designer apps starting from R2020b or newer releases.

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

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

widgets-toolbox's People

Contributors

msulliva72 avatar rjackey avatar slootsjj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

widgets-toolbox's Issues

ButtonGrid not fully customizable in appdesigner

The ButtonGrid is not fully customizable in appdesigner. This is because ButtonGrid uses string arrays as property class types. AppDesigner, however, is only compatible with string scalars, or cell arrays containing character vectors. See also the documentation on this topic.

As a result: Icons cannot be customized and text, tooltip and tags can only be set as string scalar. See also figure below.
image

Proposal:
Initialize properties as cell arrays of character vectors for appdesigner compatibility reasons.

ListSelector: Error changing Items property when Value is not empty

I am using the ListSelector to allow a user to reorder a set of options, and have multiple lists that I want to share the same ListSelector for reordering.

To do this I originally tried programmatically changing Items to the new list of options I want to reorder, then changing Value to the same list (to make all of the options show up on the widget). This results in an "index out of bounds" error.

I found that to get the behavior I want without the error I need to clear Value (~.Value = [];) first, then change Items to the new list, then change Value to the new list.

BaseApp get.PreferenceGroup fails if PreferenceGroup is not set

Due to PreferenceGroup being a string type, need to change get.PreferenceGroup away from empty char format:

    function value = get.PreferenceGroup(app)
        value = app.PreferenceGroup;
        if isempty(value)
            value = class(app);
        end
        value = matlab.lang.makeValidName(value);
    end

to:

    function value = get.PreferenceGroup(app)
        value = app.PreferenceGroup;
        if ~strlength(value)
            value = class(app);
        end
        value = matlab.lang.makeValidName(value);
    end

Enable Enter key in Password widget

One usability suggestion: for the PasswordField a really useful addition would be to capture an |Enter| key press when the cursor is in the password text field, and notify an "EnterKeyPressed" or similar class event. That way a user could listen for that event and simulate hitting "OK" or whatever is the next step in practically all password entry interfaces .
I'm no java/html expert but seems a common (and addressed) question from the html side.

Code Cleanup: Removing Redundant Dependencies

Per followup email:
○ Adjust BackgroundColorable for objects (see SliderSpinner for example)
○ Update BaseWidget to inherit BackgroundColorable
○ Remove GridOrganized mixin and have each widget have their own internal grid
○ Add copyright text to any new files, and set date to 2022
○ Remove ErrorHandling mixin from objects that don't need it (not FileSelector/BaseWidget)
○ Remove property accessors referencing BaseWidget when it inherits from ComponentContainer
○ Replace RequestUpdate() with generic update() for ListSelector widgets

Custom background color of widget should be set upon reloading app in AppDesigner

Recreate issue
Create app in AppDesigner
Add widget to app
Change background color to blue
Save and close app.
Load app again in AppDesigner.
--> Background of widget appears as default color.

Proposed fix
Listen to 'PostUpdate' event in BackgroundColorable mixin class to ensure a widget's custom background color appears in AppDesinger upon reloading the app. Changing the background color of the widget will trigger the widget's update method as well.

function listenForBackgroundChange(obj)

    % Establish Listener for Background Color Change
    if isempty(obj.BackgroundColorListener)
        obj.BackgroundColorListener = ...
            addlistener(obj,'PostUpdate',...
            @(h,e)obj.updateBackgroundColorableComponents());
    end

end %function

Event data object reused in wt.ListSelectorTwoPane

The event 'ButtonPushed' is triggered in method onButtonPushed for user buttons in classdef wt.ListSelectorTwoPane, reusing the event data. It causes multiple callbacks when the widget is nested in other widgets.

Consider recreating the event data by adding the line:
evtOut = wt.eventdata.ButtonPushedData(evt.Button);

Reference to non-existent parameter 'remArgs' in PropertyChangedData class

Class wt.eventdata.PropertyChangedData references the non-existent parameter 'remArgs'.

Change:

% Any remaining varargin are dynamic property-value pairs
for idx=1:numel(varargin)
    thisProp = varargin{idx};
    thisValue = remArgs.(thisProp);
    obj.addprop(thisProp);
    obj.(thisProp) = thisValue;
end

To:

% Any remaining varargin are dynamic property-value pairs
for idx = 1:floor(numel(varargin) / 2)
    thisProp = varargin{(idx - 1) * 2 + 1};
    thisValue = varargin{(idx - 1) * 2 + 2};
    obj.addprop(thisProp);
    obj.(thisProp) = thisValue;
end

Video Player widget

Would be nice ot have a Video Player Widget, instead of having to create a uihtml (which does not work out of the box with mp4), and play around with the events to have a control slider bar, and the speed play, etc...

ListSelector Enhancements: Web App support and Optional Add/Delete

Suggested addutions that could be made to the single pane ListSelector widget to improve usability.

  1. The single pane ListSelector uses listdlg() when adding options from the Items property to the Value property (making options visible to be reordered). The listdlg() function is not supported by Web Apps as noted on the "Web App Limitations and Unsupported Functionality" page. An alternate to the ListSelector that works with Web Apps would be very useful.

  2. The Add/Delete/Move Up/Move Down buttons for the single pane ListSelector are invisible until one of the options in the list is selected, desired to have them be visible initially. Examples page on File Exchange notes that reordering buttons can be made optional, could not locate property that controls this. Would like option to also make the Add/Delete buttons optional to use widget purely to reorder Items in the list.

Add FileSelector pattern option from legacy widgets

The FileSelector widget in this version of the Toolbox does not have the same "Pattern" option that the pre-uifigure Toolbox had, so it is restricted to only searching for Matlab file types and cannot be setup to only search for .CSV or .TXT files, for example. This would be a very useful thing to bring back, I was able to copy the functionality from the old toolbox into a copy of this widget to get it working for me.

DatetimeSelector ValueChanged callback does not include PreviousValue

DatetimeSelector widget's protected methods: onDateEdited(), onTimeEdited(), and onTimeZoneChanged() do not include the previous value from the "evt" struct passed into them with the "evtOut" struct they then pass to the ValueChanged callback in App Designer.

Result is that the callback exposed within App Designer's Code View will always have "event.PreviousValue" equal "[ ]".

function onDateEdited(obj,evt)

BaseWidget should ensure BackgroundColorListener is set so that Grid will be updated

Add this to constructor to ensure background color listener is still set if the concrete class doesn't modify the BackgroundColorableComponents. This ensures it will still update the color of the Grid on background change.

        function obj = BaseWidget(varargin)

            % Attach internal postSetup callback
            args = horzcat(varargin, {"CreateFcn",  @(src,evt)postSetup_I(src)});

            % Call superclass constructor
            obj = [email protected](args{:});

            % Ensure background color listener has been generated
            if isempty(obj.BackgroundColorListener)
                obj.updateBackgroundColorableComponents()
                obj.listenForBackgroundChange();
            end

        end %function

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.