7575 end % methods
7676
7777
78+ %% Lower Button Properties
79+ % The dialog subclass can change these values
80+ properties (Dependent )
81+
82+ LowerButtonText
83+
84+ LowerButtonTag
85+
86+ LowerButtonTooltip
87+
88+ LowerButtonEnable
89+
90+ LowerButtonWidth
91+
92+ LowerButtonHeight
93+
94+ end % methods
95+
96+ % Accessors
97+ methods
98+
99+ function value = get .LowerButtonText(obj )
100+ value = obj .LowerButtons .Text ;
101+ end
102+ function set .LowerButtonText(obj ,value )
103+ obj.LowerButtons.Text = value ;
104+ end
105+
106+ function value = get .LowerButtonTag(obj )
107+ value = obj .LowerButtons .ButtonTag ;
108+ end
109+ function set .LowerButtonTag(obj ,value )
110+ obj.LowerButtons.ButtonTag = value ;
111+ end
112+
113+ function value = get .LowerButtonTooltip(obj )
114+ value = obj .LowerButtons .Tooltip ;
115+ end
116+ function set .LowerButtonTooltip(obj ,value )
117+ obj.LowerButtons.Tooltip = value ;
118+ end
119+
120+ function value = get .LowerButtonEnable(obj )
121+ value = obj .LowerButtons .ButtonEnable ;
122+ end
123+ function set .LowerButtonEnable(obj ,value )
124+ obj.LowerButtons.ButtonEnable = value ;
125+ end
126+
127+ function value = get .LowerButtonWidth(obj )
128+ value = obj .LowerButtons .ButtonWidth ;
129+ end
130+ function set .LowerButtonWidth(obj ,value )
131+ obj.LowerButtons.ButtonWidth = value ;
132+ end
133+
134+ function value = get .LowerButtonHeight(obj )
135+ value = obj .LowerButtons .ButtonHeight ;
136+ end
137+ function set .LowerButtonHeight(obj ,value )
138+ obj.LowerButtons.ButtonHeight = value ;
139+ end
140+
141+ end % methods
142+
143+
78144 %% Internal Properties
79145 properties (Transient , NonCopyable , Hidden , SetAccess = private )
80146
105171 % Modal image (optional)
106172 ModalImage matlab.ui.control.Image
107173
174+ % Lower buttons (optional)
175+ LowerButtons wt.ButtonGrid
176+
108177 end % properties
109178
110179
@@ -199,17 +268,6 @@ function positionOver(obj, refComp)
199268
200269 end % function
201270
202-
203- function b = addButtons(obj , labels )
204- % Adds buttons to the lower dialog area
205-
206- b = wt .ButtonGrid(obj .InnerGrid ," Text" ,labels ," Icon" ,[]);
207- b .ButtonWidth(: ) = {' fit' };
208- b.Layout.Row = 2 ;
209- b.Layout.Column = 2 ;
210-
211- end % function
212-
213271 end % methods
214272
215273
@@ -239,6 +297,7 @@ function setup(obj)
239297 % Close Button
240298 obj.CloseButton = uibutton(obj .OuterPanel );
241299 obj.CloseButton.Text = " " ;
300+ obj.CloseButton.Tag = " close" ;
242301 obj.CloseButton.IconAlignment = " center" ;
243302 obj.CloseButton.ButtonPushedFcn = @(src ,evt )obj .onClosePushed();
244303
@@ -286,6 +345,12 @@ function setup(obj)
286345 szF = posF(3 : 4 );
287346 obj.ModalImage.Position = [1 1 szF ];
288347
348+ % Add lower buttons
349+ obj.LowerButtons = wt .ButtonGrid(obj .InnerGrid ," Text" ,[]," Icon" ,[]);
350+ obj.LowerButtons.Layout.Row = 2 ;
351+ obj.LowerButtons.Layout.Column = 2 ;
352+ obj.LowerButtons.DefaultSize = ' fit' ;
353+
289354 % Bring the dialog back to the top
290355 uistack(obj ," top" );
291356
@@ -307,6 +372,19 @@ function update(obj)
307372 obj .repositionCloseButton();
308373
309374 end % function
375+
376+
377+ function updateBackgroundColorableComponents(obj )
378+ % Update components that are affected by BackgroundColor
379+ % (overrides the superclass method)
380+
381+ % Update grid color
382+ set([obj .InnerGrid , obj .Grid ], " BackgroundColor" , obj .BackgroundColor );
383+
384+ % Call superclass method
385+ obj .updateBackgroundColorableComponents @wt .mixin .BackgroundColorable();
386+
387+ end % function
310388
311389
312390 function onClosePushed(obj )
0 commit comments