Problems with programmatically adding 'TabName' property value in mask.

1 次查看(过去 30 天)
I attempted to programmatically add a 'TabName' parameter in my mask interface using the following commands:
mask_obj = Simulink.Mask.get('PRL/array_concat1'); mask_obj.addParameter('Type','popup','TypeOptions',{'Red' 'Blue' 'Green'},'Evaluate','off','TabName','Properties');
However, it doesn't set the tabname and sends the following warning.
Warning: 'TabName' cannot be set for 'PRL/array_concat1' as it will be removed in a future release. Use tab dialog controls to add parameters to tabs
I am currently using version 2014a and the current documentation (<http://www.mathworks.com/help/simulink/slref/simulink.mask.addparameter.html>) explicitely states that it is possible to set the TabName property and there is no mention of this feature being disabled. This capability is very important to me since I have to programmatically create mask interfaces for hundreds of blocks as part of my library development. To add in the tab functionality manually is too painful. Does anyone know a workaround? Why was this feature removed and why does the documentation claim it is still supported? Thanks in advance for your help on this.
Bryan

采纳的回答

Drew Davis
Drew Davis 2015-6-8
Try setting the tab names with the following commands:
mask = Simulink.Mask.get('blockpath');
tab = mask.getDialogControl('currentTabName');
tab.Name = 'newTabName'
tab.Prompt = 'My tab'
See the following documentation page for more information regarding creating tabs programmatically http://www.mathworks.com/help/simulink/slref/simulink.mask.adddialogcontrol.html

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by