Skip to content

Commit

Permalink
Merge pull request #8 from Dev-iL/develop
Browse files Browse the repository at this point in the history
Addressing issues #1, #6, and #7
  • Loading branch information
sco1 authored Jan 7, 2018
2 parents 88b82f6 + cf496a9 commit 947c54e
Show file tree
Hide file tree
Showing 4 changed files with 352 additions and 161 deletions.
24 changes: 15 additions & 9 deletions Demo/TableDemo.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,54 @@
UITable matlab.ui.control.Table
Button matlab.ui.control.Button
end

properties (Access = private, Constant = true)
ID_ATTRIBUTE_NAME = 'id';
end

methods (Access = private)

% Button pushed function: Button
function ButtonPushed(app, ~)
% Return all registered widgets:
IAN = app.ID_ATTRIBUTE_NAME;
hWin = mlapptools.getWebWindow(app.UIFigure);
% Return all registered widgets:
[~,w] = mlapptools.getWidgetList(app.UIFigure);
% Filter list:
w = w(~cellfun(@isempty,w.id) & ...
cellfun(@(x)~isempty(strfind(x,'uniq')),w.id),:); %#ok<STREMP>
% Apply random styles:
for ind1 = 1:4:size(w,1)
mlapptools.setStyle(...
app.UIFigure,...
hWin,...
'border',...
'2px solid red',...
w{ind1,'id'}{1});
struct('ID_attr',IAN,'ID_val',w{ind1,IAN}{1}));
end

for ind2 = 2:4:size(w,1)
mlapptools.setStyle(...
app.UIFigure,...
hWin,...
'background-image',...
'url(http://lorempixel.com/40/120/)',...
w{ind2,'id'}{1});
struct('ID_attr',IAN,'ID_val',w{ind2,IAN}{1}));
end

for ind3 = 3:4:size(w,1)
mlapptools.setStyle(...
app.UIFigure,...
hWin,...
'background-color',...
['rgb(' num2str(randi(255)) ',' num2str(randi(255)) ',' ...
num2str(randi(255)) +')'],...
w{ind3,'id'}{1});
struct('ID_attr',IAN,'ID_val',w{ind3,IAN}{1}));
end

for ind4 = 4:4:size(w,1)
mlapptools.setStyle(...
app.UIFigure,...
hWin,...
'padding',...
'0cm 1cm 0cm 0cm',...
w{ind4,'id'}{1});
struct('ID_attr',IAN,'ID_val',w{ind4,IAN}{1}));
end

end
Expand Down
Loading

0 comments on commit 947c54e

Please sign in to comment.