Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
uipanel within uipanel problem

Subject: uipanel within uipanel problem

From: Yoav Rubin

Date: 18 Dec, 2007 11:33:14

Message: 1 of 3

Hi all, I am building a figure that reads data and displays
each data item using static text controls which are appended
one underneath the other. Since there are many data items, I
wanted to allow scrolling, and not resizing all of the figure.
In order to do so I added in the figure a uipanel (let's
call it outerPanel)and as its child I added another uipanel
(let's call it innerPanel). I added a slider and did the
needed calculations to sync between the slider's value and
the innerPanel's position within the outerPanel. The problem
is that when the innerPanel height gets larger then the
outerPanel height, the innerPanel just spills out of the
outerPanel, and all of it is presented, instead of only a
portion of the innerPanel (that portion's height should be
the outerPane height's).
Does anyone has any idea how to prevent the innerPanel from
spilling?

thanks
Yoav

Subject: uipanel within uipanel problem

From: Yair Altman

Date: 18 Dec, 2007 14:44:12

Message: 2 of 3

"Yoav Rubin" <yoavrubin@hotmail.com> wrote in message
<fk8b5q$pl7$1@fred.mathworks.com>...
> Hi all, I am building a figure that reads data and displays
> each data item using static text controls which are appended
> one underneath the other. Since there are many data items, I
> wanted to allow scrolling, and not resizing all of the figure.
> In order to do so I added in the figure a uipanel (let's
> call it outerPanel)and as its child I added another uipanel
> (let's call it innerPanel). I added a slider and did the
> needed calculations to sync between the slider's value and
> the innerPanel's position within the outerPanel. The problem
> is that when the innerPanel height gets larger then the
> outerPanel height, the innerPanel just spills out of the
> outerPanel, and all of it is presented, instead of only a
> portion of the innerPanel (that portion's height should be
> the outerPane height's).
> Does anyone has any idea how to prevent the innerPanel
> from spilling?
>
> thanks
> Yoav


You could do all this programmatically. However, if all you
need is to scroll a bunch of text labels, then it's much
easier to use a ListBox uicontrol, or a JScrollPane object:
http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html

Yair Altman
http://ymasoftware.com

Subject: uipanel within uipanel problem

From: Yoav Rubin

Date: 18 Dec, 2007 19:00:54

Message: 3 of 3

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message
<fk8mbs$qjq$1@fred.mathworks.com>...
> "Yoav Rubin" <yoavrubin@hotmail.com> wrote in message
> <fk8b5q$pl7$1@fred.mathworks.com>...
> > Hi all, I am building a figure that reads data and displays
> > each data item using static text controls which are appended
> > one underneath the other. Since there are many data items, I
> > wanted to allow scrolling, and not resizing all of the
figure.
> > In order to do so I added in the figure a uipanel (let's
> > call it outerPanel)and as its child I added another uipanel
> > (let's call it innerPanel). I added a slider and did the
> > needed calculations to sync between the slider's value and
> > the innerPanel's position within the outerPanel. The problem
> > is that when the innerPanel height gets larger then the
> > outerPanel height, the innerPanel just spills out of the
> > outerPanel, and all of it is presented, instead of only a
> > portion of the innerPanel (that portion's height should be
> > the outerPane height's).
> > Does anyone has any idea how to prevent the innerPanel
> > from spilling?
> >
> > thanks
> > Yoav
>
>
> You could do all this programmatically. However, if all you
> need is to scroll a bunch of text labels, then it's much
> easier to use a ListBox uicontrol, or a JScrollPane object:
>
http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html
>
> Yair Altman
> http://ymasoftware.com

I actually a little simplified the problem, apart of the
text labels I also put besides them other controls (each row
of controls in built of a button, checkbox static text and
edit controls), thus I can't use the listbox ui control. Is
there a solution for this problem using basic matlab
controls and not using Java? Is it a matlab bug that occurs
when using uipanel within uipanel, because I've used several
times axes control inside a uipanel to provide scrolling of
large images with relatively small viewing window?

does someone has any additional idea?

thanks
Yoav

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us