UIpanel within an UIpanel problem

I realized I posted this in a Newsgroup, not the Matlab Answers page:
I am having a uipanel within an uipanel problem
I set
p4 = uipanel
then I set
p4_1 = uipanel,
and
p4_1.Parent = p4
Then I create some uicontrol text, and place p4_1 as its parent.
When I click on the GUI figure and choose the arrow button (to manually move around the text) I can highlight the text, but cannot resize or move it.
Any ideas why this is the case?
Thanks

4 comentarios

Geoff Hayes
Geoff Hayes el 12 de Sept. de 2015
Joe - please attach your code so that we can help (more) with troubleshooting this problem.
Joe
Joe el 14 de Sept. de 2015
%Creates Variables Panel
p4 = uipanel;
p4.Position = [0.0314 0.6406 0.2606 0.1930];
p4.Units = 'normalized';
p4.Title = 'Variables';
%Sub Panel 1
p4_1 = uipanel;
p4_1.Position = [0.2841 0.0709 0.6902 0.7039];
p4_1.Units = 'normalized';
p4_1.Title = 'Sub Panel';
p4_1.Parent = p4;
%Frequency Box
handles.vibF = uicontrol('Style', 'edit');
handles.vibF.Parent = p4_1;
handles.vibF.Units = 'normalized';
handles.vibF.Position = [0.0295 0.1396 0.2846 0.1915];
handles.vibF.Value = [];
%Vibration Frequency Text
handles.vibFT = uicontrol('Style', 'text');
handles.vibFT.Parent = p4_1;
handles.vibFT.Units = 'normalized';
handles.vibFT.Position = [-0.0101 0.4072 0.3440 0.0984];
handles.vibFT.String = 'Frequency [Hz]';
%Dual Frequency Box
handles.shotF = uicontrol('Style', 'edit');
handles.shotF.Parent = p4_1;
handles.shotF.Units = 'normalized';
handles.shotF.Position = [0.358 0.1396 0.2846 0.1915];
handles.shotF.Value = [];
%Dual Frequency Text
handles.shotFT = uicontrol('Style', 'text');
handles.shotFT.Parent = p4_1;
handles.shotFT.Units = 'normalized';
handles.shotFT.Position = [0.3294 0.4072 0.3440 0.0984];
handles.shotFT.String = 'Dual Frequency [Hz]';
%Vibration Magnitude Box
handles.vibM = uicontrol('Style', 'edit');
handles.vibM.Parent = p4_1;
handles.vibM.Units = 'normalized';
handles.vibM.Position = [0.6785 0.1396 0.2846 0.1915];
handles.vibM.Value = [];
%Vibration Magnitude Text
handles.vibMT = uicontrol('Style', 'text');
handles.vibMT.Parent = p4_1;
handles.vibMT.Units = 'normalized';
handles.vibMT.Position = [0.6630 0.4072 0.3440 0.0984];
handles.vibMT.String = 'Vibration (+/-) Mag';
end
Walter Roberson
Walter Roberson el 14 de Sept. de 2015
There is no uicontrol() callback to resize or move text. Are you referring to the Object Inspector functionality?
GUIDE might provide a mechanism to change such things while you are in GUIDE, but uipanel nested inside uipanel are not something you can build with GUIDE.
Joe
Joe el 15 de Sept. de 2015
Editada: Joe el 15 de Sept. de 2015
Walter,
Once the GUI is created, I go to the GUI window, click the white arrow and then click on the text I want to move / re-size. Then I can use my mouse to drag around and re-size the object I've selected.
Then I figure out the new Position of that item I moved, and hard code it into the GUI code. The problem is that I can't move / resize the object I selected with my mouse if it's in a uipanel nested inside of another uipanel.
For example, I cannot grab the little blue corner boxes around the Frequency Text box with my mouse. If the text box were in a single uipanel (not nested within another) I would be able to grab the blue corners with my mouse.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre App Building en Centro de ayuda y File Exchange.

Preguntada:

Joe
el 11 de Sept. de 2015

Editada:

Joe
el 15 de Sept. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by