Prev: LEVMAR with MEX
Next: NTC Thermistor Model
From: jens on 22 May 2010 06:11 Hi All I want to align some strings in a GUI. I have the following example: h={'Product Name' 'Price' 'Code'} j={'Newcastle' '20' 'EU20'} bongo=[h ;j] set(h,'string',sprintf('%s %s\n',bongo{:}))% h is a handle to a text box. I want the left column to be vertical aligned. Both h and j har cellarrays which contains many numbers and characters. Maybe I could make some code that extend the strings in the left column if the length of the strings are different? Best Regards Jens
From: jens on 23 May 2010 11:28 "jens " <pascal(a)hotmail.com> wrote in message <ht8ajr$sfr$1(a)fred.mathworks.com>... > Hi All > > I want to align some strings in a GUI. I have the following example: > > > h={'Product Name' 'Price' 'Code'} > j={'Newcastle' '20' 'EU20'} > bongo=[h ;j] > > set(h,'string',sprintf('%s %s\n',bongo{:}))% h is a handle to a text box. > > > I want the left column to be vertical aligned. Both h and j har cellarrays which contains many numbers and characters. Maybe I could make some code that extend the strings in the left column if the length of the strings are different? > > Best Regards > > Jens Hi Does anybody know how to fix my problem? /jens
From: Walter Roberson on 23 May 2010 11:37 jens wrote: > "jens " <pascal(a)hotmail.com> wrote in message > <ht8ajr$sfr$1(a)fred.mathworks.com>... >> I want to align some strings in a GUI. I have the following example: >> >> >> h={'Product Name' 'Price' 'Code'} >> j={'Newcastle' '20' 'EU20'} >> bongo=[h ;j] >> set(h,'string',sprintf('%s %s\n',bongo{:}))% h >> is a handle to a text box. >> >> I want the left column to be vertical aligned. Both h and j har >> cellarrays which contains many numbers and characters. Maybe I could >> make some code that extend the strings in the left column if the >> length of the strings are different? > Does anybody know how to fix my problem? http://www.mathworks.com/access/helpdesk/help/techdoc/ref/uicontrol_props.html#bqxoims HorizontalAlignment left | {center} | right Horizontal alignment of label string. This property determines the justification of the text defined for the String property (the uicontrol label): * left â Text is left justified with respect to the uicontrol. * center â Text is centered with respect to the uicontrol. * right â Text is right justified with respect to the uicontrol. On Microsoft Windows systems, this property affects only edit and text uicontrols.
From: Yair Altman on 23 May 2010 16:18 Walter Roberson <roberson(a)hushmail.com> wrote ... > HorizontalAlignment > left | {center} | right > On Microsoft Windows systems, this property affects only edit and > text uicontrols. Since the OP had a textbox, this will indeed solve the OP's problem. But for anyone who is interested, the HorizontalAlignment can be set for all other uicontrols using their underlying Java component, which can be retrieved via the FindJObj utility on the File Exchange. The same Java object can also be used to set the VerticalAlignment property and quite a few other useful properties that Matlab does not expose. Yair Altman http://UndocumentedMatlab.com
From: jens on 28 May 2010 02:03 "Yair Altman" <altmanyDEL(a)gmailDEL.comDEL> wrote in message <htc2hs$2mv$1(a)fred.mathworks.com>... > Walter Roberson <roberson(a)hushmail.com> wrote ... > > HorizontalAlignment > > left | {center} | right > > On Microsoft Windows systems, this property affects only edit and > > text uicontrols. > > Since the OP had a textbox, this will indeed solve the OP's problem. But for anyone who is interested, the HorizontalAlignment can be set for all other uicontrols using their underlying Java component, which can be retrieved via the FindJObj utility on the File Exchange. > > The same Java object can also be used to set the VerticalAlignment property and quite a few other useful properties that Matlab does not expose. > > Yair Altman > http://UndocumentedMatlab.com Thanks Yair and Walter Jens
|
Pages: 1 Prev: LEVMAR with MEX Next: NTC Thermistor Model |