Code covered by the BSD License  

Highlights from
fixuilabels

Be the first to rate this file! 15 Downloads (last 30 days) File Size: 2.86 KB File ID: #42188
image thumbnail

fixuilabels

by

 

Change 'text' uicontrol objects' vertical alignment

| Watch this File

File Information
Description

'Text' style uicontrols align vertically to 'top', which is different from 'edit' style uicontrols, which aligns to 'middle' (as of R2013a). However, Matlab does not expose uicontrol's 'VerticalAlignment' setting for uicontrol object. Here is the fix.

FIXUILABELS traverses through the java objects contained within the current MATLAB figure and adjust the underlying java objects for all the 'text' style uicontrols so that their texts better line up with the adjacent 'edit' style uicontrols at the same height.

FIXUILABELS(FIG) fixes the uicontrols in the figure with handle FIG.

Caveat: After the fix, 'text' control is positioned 1 px below 'edit' control. I have not resolved this yet without changing the uicontrols' position. If anyone has a solution, please leave a comment!

Acknowledgements

Find J Obj Find Java Handles Of Matlab Graphic Objects inspired this file.

Required Products MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us