Skip to content

Commit 0035955

Browse files
committed
work on BaseInternalDialog (formerly BaseDialog2) and Login dialog example
1 parent 0527cb7 commit 0035955

File tree

9 files changed

+362
-130
lines changed

9 files changed

+362
-130
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Info location="DialogButtonPushedData.m" type="File"/>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="design"/>
5+
</Category>
6+
</Info>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Info location="BaseInternalDialog.m" type="File"/>

resources/project/Wqze2RguMm8RygQI0Uykdot17AI/c_HS62VA0zMmX7JJZQ-pFGZJVGIp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

widgets/+wt/+abstract/BaseDialog.m

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
wt.mixin.FieldColorable
55
% Base class for a dialog panel
66

7-
% Copyright 2022-2025 The MathWorks Inc.
8-
7+
% Please note this is an experimental component that may change in the
8+
% future.
9+
10+
% Copyright 2022-2025 The MathWorks Inc.
11+
912

1013
%% Public Properties
1114
properties (AbortSet, Dependent, Access = public)
@@ -39,14 +42,14 @@
3942
end
4043

4144
end %methods
42-
45+
4346

4447
%% Internal Properties
4548
properties (Transient, NonCopyable, Hidden, SetAccess = private)
4649

4750
% Dialog's grid managing the outer container
4851
DialogGrid matlab.ui.container.GridLayout
49-
52+
5053
% Title text
5154
TitleBar matlab.ui.control.Label
5255

@@ -62,13 +65,13 @@
6265

6366
%% Protected methods
6467
methods (Access = protected)
65-
68+
6669
function setup(obj)
6770
% Configure the widget
6871

6972
% Call superclass method
7073
obj.setup@wt.abstract.BaseWidget();
71-
74+
7275
% Outer Grid to manage building blocks
7376
obj.DialogGrid = uigridlayout(obj);
7477
obj.DialogGrid.RowHeight = {'fit','1x'};
@@ -91,20 +94,20 @@ function setup(obj)
9194
obj.CloseButton.ButtonPushedFcn = @(src,evt)obj.onClosePressed();
9295
obj.CloseButton.Layout.Row = 1;
9396
obj.CloseButton.Layout.Column = 2;
94-
97+
9598
% Inner Grid to manage building blocks
9699
obj.Grid.Parent = obj.DialogGrid;
97100
obj.Grid.Padding = 10;
98101
obj.Grid.Scrollable = true;
99102
obj.Grid.Layout.Row = 2;
100103
obj.Grid.Layout.Column = [1 2];
101-
104+
102105
end %function
103106

104-
107+
105108
function updateBackgroundColorableComponents(obj)
106109
% Update components that are affected by BackgroundColor
107-
110+
108111
% Update dialog components
109112
set(obj.TitleBar, "BackgroundColor", obj.BackgroundColor);
110113

@@ -113,10 +116,10 @@ function updateBackgroundColorableComponents(obj)
113116

114117
end %function
115118

116-
119+
117120
function updateButtonColorableComponents(obj)
118121
% Update components that are affected by ButtonColor
119-
122+
120123
% Update dialog components
121124
set(obj.CloseButton, "BackgroundColor", obj.ButtonColor);
122125

@@ -202,7 +205,7 @@ function positionWithin(obj, fig, referenceWidget)
202205

203206
% Set final position
204207
obj.Position = [dlgPos dlgSize];
205-
208+
206209
end %function
207210

208211

@@ -211,7 +214,7 @@ function positionWithin(obj, fig, referenceWidget)
211214
% grid)
212215

213216
arguments
214-
obj %#ok<INUSA>
217+
obj %#ok<INUSA>
215218
names (:,1) string
216219
parent = obj.Grid
217220
column = 1
@@ -236,7 +239,7 @@ function positionWithin(obj, fig, referenceWidget)
236239

237240
% Remove the empty spaces
238241
labels(~hasText) = [];
239-
242+
240243
end %function
241244

242245

@@ -253,7 +256,7 @@ function attachLifecycleListeners(obj, listenObj)
253256

254257
arguments
255258
obj (1,1) wt.abstract.BaseDialog
256-
listenObj handle
259+
listenObj handle
257260
end
258261

259262
% Create listeners
@@ -304,7 +307,7 @@ function copyStylesFromReference(obj, reference)
304307

305308

306309
end %function
307-
310+
308311
end %methods
309312

310313
end %classdef

0 commit comments

Comments
 (0)