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:
set autoscroll for uipanel

Subject: set autoscroll for uipanel

From: airo

Date: 29 Mar, 2009 13:36:48

Message: 1 of 9

Hi all,
I need to set autoscroll for uipanel in my GUI that can appear when I
resize the window. I know that Java can do this but I dont know how to
add java in my GUI. Can anybody help me?
I use MATLAB R2008b.

thanks

Subject: set autoscroll for uipanel

From: Sprinceana

Date: 30 Mar, 2009 08:16:01

Message: 2 of 9

airo <a.ostovari@gmail.com> wrote in message <143d0af2-411a-4af0-9ceb-63f1918bbdd3@j39g2000yqn.googlegroups.com>...
> Hi all,
> I need to set autoscroll for uipanel in my GUI that can appear when I
> resize the window. I know that Java can do this but I dont know how to
> add java in my GUI. Can anybody help me?
> I use MATLAB R2008b.
>
> thanks

Syntax:


h = uipanel('PropertyName1',value1,'PropertyName2',value2,..);

where h is a object used for creating your panel.


As far as I know panels in matlab don't have an autoscroll property. But wait for another answer.

For looking to all properties of this component hit F1 click on search tab and type uipanel.

There you have described all the properties and a short example with a printscreen.




Or simply use

>>doc uipanel

on command window

Hope that this helps,

Michael

Subject: set autoscroll for uipanel

From: airo

Date: 30 Mar, 2009 21:10:10

Message: 3 of 9

On Mar 30, 12:16=A0pm, "Sprinceana " <mihai...@yahoo.com> wrote:
> airo <a.ostov...@gmail.com> wrote in message <143d0af2-411a-4af0-9ceb-63f=
1918bb...@j39g2000yqn.googlegroups.com>...
> Syntax:
>
> h =3D uipanel('PropertyName1',value1,'PropertyName2',value2,..);
>
> where h is a object used for creating your panel.
>
> As far as I know panels in matlab don't have an autoscroll property. But =
wait for another answer.
>
> For looking to all properties of this component hit =A0F1 click on search=
 tab and type uipanel.
>
> There you have described all the properties and a short example with a pr=
intscreen.
>
> Or simply use
>
> >>doc uipanel
>
> on command window
>
> Hope that this helps,
>
> Michael

Thank you Michael for your reply, I know that autoscroll is not in the
uipanel properties. I dont know how to set autoscroll in my gui. I
just know that java do this but Idont know how to set it in my gui.

Subject: set autoscroll for uipanel

From: Yair Altman

Date: 31 Mar, 2009 00:34:01

Message: 4 of 9

It's not supported out-of-the-box in Matlab. You need to program this, and it's not trivial to do so correctly (accounting for resizes etc.). You can start with the code here: http://matlabwiki.mathworks.com/MATLAB_FAQ#I_want_to_use_a_scrollbar_to_scroll_my_edit_boxes.2Fbuttons

If you use java it's easy to set up a JScrollPane, but you will only be able to set controls in there - not Matlab axes/plots - so it's not a general panacea.

Yair Altman
http://UndocumentedMatlab.com
 

Subject: set autoscroll for uipanel

From: airo

Date: 31 Mar, 2009 20:21:42

Message: 5 of 9

Thank you Yair for your information

Subject: set autoscroll for uipanel

From: airo

Date: 31 Mar, 2009 20:23:16

Message: 6 of 9

Thank you Yair for your information

Subject: set autoscroll for uipanel

From: Phil Goddard

Date: 31 Mar, 2009 20:54:01

Message: 7 of 9


I regularly use sliders (positioned vertically on the right of a figure and horizontally across the bottom) to mimic scrollbars.
An example of doing this can be found on the file exchange:
http://www.mathworks.com/matlabcentral/fileexchange/10573

As with the link that Yair has pointed you towards the hard part is to appropriately re-position all the UI components when the sliders are slid.

Phil.

Subject: set autoscroll for uipanel

From: Marino Bajcic

Date: 16 Jan, 2012 08:55:08

Message: 8 of 9

airo <a.ostovari@gmail.com> wrote in message <143d0af2-411a-4af0-9ceb-63f1918bbdd3@j39g2000yqn.googlegroups.com>...
> Hi all,
> I need to set autoscroll for uipanel in my GUI that can appear when I
> resize the window. I know that Java can do this but I dont know how to
> add java in my GUI. Can anybody help me?
> I use MATLAB R2008b.
>
> thanks


Hi,
You can try this solution with auto scroll for complete GUI.
http://www.mathworks.com/matlabcentral/fileexchange/?term=autoscroll

Subject: set autoscroll for uipanel

From: Gerard

Date: 8 May, 2013 18:14:09

Message: 9 of 9

Hello!
I was also looking for an answer to this and found this solution. I realize this is probably late but it might help others in our position.

I'm using a listbox to display data in real time as it is captured from an Arduino via a serial port. One of the listbox uicontrol values is ListboxTop. ListboxTop is the top line that is displayed within the listbox and it is set to 1 by default. You can change the uicontrols using the command: set(handles.the listbox's tag,'uicontrol to change',value) . So what I did is I created an if statement that changes the top displayed value to what it should be to give the listbox a scrolling effect. Here's an example, skip to the %%%%% WHAT YOU'RE AFTER section if you get bored.

function rxButton_Callback(hObject, eventdata, handles)
%(rxButton is the button I press to initiate data reception)
s = serial('COM8');
%(In my program I'm receiving data from a serial port, COM8)
set(s,'BaudRate',9600);
fopen(s);
%(^setting serial port setttings and opening serial port)

set(handles.rxButton, 'Enable', 'Off');
%(Turn off button while data is being received)
lbt=0; %initiate my listbox top line counter
for count=1:1:20 %take data for 20*.5 seconds-explained later
    currList = get(handles.terminal, 'String');
%(my listbox is tagged 'terminal', here i get the current content and store it in currList
    out(count,:) = fscanf(s,'%s');
%(scan serial port for the data) and store it in out
    set(handles.terminal, 'String', ...
        [currList; ['Received @ ' datestr(now) ': ' out(count,:)] ]);
%resest the string in the listbox to include new data

%%%%%%%WHAT YOU'RE AFTER
    if count>11
        lbt=lbt+1;
        set(handles.terminal,'ListboxTop', lbt)
    end
pause(.5)
end
%%%%% My listbox is 11 lines high, so after 11 lines of data comes through my
%%%%% top line is changed in one step increments, this shifts the text up like an
%%%%% auto scroll. To prevent MATLAB from nearly instantaneously grabbing the %%%%% next data string, the pause() function tells MATLAB to wait .5 seconds,
%%%%% which is the same rate that I set my instrument to spit data out.

%%% finishing up
set(handles.rxButton, 'Enable', 'On');
fclose(s)
delete(s)
clear s
%% here, the receive button is made available again and the serial port is closed, cleared cleared and made ready for more data.

Hope this helps. Let me know if you have any questions!
-gpdesjardins1@gmail.com

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