File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,18 @@ function onButtonPushed(obj,evt)
180180
181181 end % function
182182
183+ function updateGridForButton(obj , prop , value )
184+ % Update main grid properties to value
185+
186+ % If value is a scalar, repeat it for every button.
187+ if isscalar(value )
188+ nCells = numel(obj .Grid.(prop ));
189+ value = repmat(value , 1 , nCells );
190+ end
191+ obj .Grid.(prop ) = value ;
192+
193+ end % function
194+
183195 end % methods
184196
185197
@@ -191,14 +203,14 @@ function onButtonPushed(obj,evt)
191203 value = obj .Grid .ColumnWidth ;
192204 end
193205 function set .ButtonWidth(obj ,value )
194- obj.Grid. ColumnWidth = value ;
206+ obj .updateGridForButton( " ColumnWidth" , value ) ;
195207 end
196208
197209 function value = get .ButtonHeight(obj )
198210 value = obj .Grid .RowHeight ;
199211 end
200212 function set .ButtonHeight(obj ,value )
201- obj.Grid. RowHeight = value ;
213+ obj .updateGridForButton( " RowHeight" , value ) ;
202214 end
203215
204216 end % methods
You can’t perform that action at this time.
0 commit comments