Thanks for this, Matthew. One question though. There may be an issue with maintaining the 'Enable' setting of the children. In my GUI I have a toolbar, and some tools are only available in certain situations. Setting the children's 'Enable' state works fine, until I select a tool, at which point all disabed buttons become enabled.
There is an easy workaround, of course, to re-disable the disabled buttons at the end of the callback function. However I though I would bring the issue to your attention.
I have a naive question. If I open Figure Palette (ML R14) in figure window, I get any line object highlighted if I click it. This is reasonable, because it allows to see gco. Apparently, in the submission discussed here the highlighting has some other meaning. Which one?
Another question is for Doug. If I open uicontextmenu for gco with right button, I see option CUT, but there are no important options MOVE, BLOW UP/DOWN (both implemented in RECTANGLE AND ELLIPSE), and ROTATE (strangely, Rotate3D button in main toolbar cannot rotate single objects within fixed 2D axis). Of course, one can modify uicontextmenu, but such options are very general, why not yet implemented?
Furthermore, if I have a line object within RECTANGLE or ELLIPSE brought into axis from Annotations,instead of that object only RECTANGLE or ELLIPSE are always selected by clicking the line object. This seems to me inconsistent. What is the explanation for that? Apparently, RECTANGLE and ELLIPSE consider not only the perimiter, but also inner points as their own property. This is very inconvenient for users.
Absolutely terrific! Thanks to the authors for this incredibly useful tool.
I have encountered one problem - I find that figures which contain the GridFlex object cannot be saved to disk without hanging Matlab. If I simply replace GridFlex with Grid then all is well. When a figure with GridFlex is saved the file is actually written to disk but Matlab has to be manually killed. When the saved figure is subsequently reloaded it generates a slew of errors like this:
??? Attempt to reference field of
non-structure array.
Error in ==>
MousePointerHandler>@(varargin)obj.onMouseMoved(varargin{:})
at 42
set(fig,'WindowButtonMotionFcn',
@obj.onMouseMoved);
Great tool.
There is a problem with the BoxPanel. The widgets do not get the correct color when I set it to a different color than the default blueish one (in fact the widget color is hardcoded as 'titleColor' at line 71).
Great Submission, the GUIs have a nice look.
I've experienced the same problem as Brett with "vanishing axes" but ao far didn't have any succes with his solution.
Any other ideas why this problem might occur?
Eva
Hi Ben,
Thanks for the reply, I think I found my problem though. It had to do with having an axes which was a child of an HBox that was embedded in a bunch of VBox & HBox's and setting the selectedChild to a tab where the axes wasn't. I was able to fix it by making sure the VBox & HBox's units were set to normalized and the position set to [0 0 1 1].
Here is an example though to illustrate. The first time you run it you'll notice that 'Page 2' appears empty. If you run it again with the last line commented out then it appears to work fine. If you run it one last time with the last line uncommented and the first HBox with the units as normalized and position [0 0 1 1] (uncomment line 7, comment line 8) then you can start on the first Page and still have Page 2 work properly.
%Example of 'disappearing' axes
newFig = figure('Toolbar', 'None', 'MenuBar', 'None', 'Position', [0 0 200 350]);
g = uiextras.TabPanel('Parent', newFig);
uicontrol('Parent', g, 'Background','r')
% z = uiextras.HBox('Parent', g,'Units', 'normalized', 'Position', [0 0 1 1]);
z = uiextras.HBox('Parent', g);
uiextras.Empty('Parent', z);
y = uiextras.VBox('Parent', z);
uiextras.Empty('Parent', y);
zxcv = axes('Parent', y,...
'ActivePositionProperty', 'Position', ...
'GridLineStyle', 'none', 'TickLength',...
[0 0],'XLim',[0 11], 'YLim', [0 11]);
tData = uint8(round(rand(10,10,3).*255));
image('Parent', zxcv, 'CData', tData);
uiextras.Empty('Parent', y);
set(y, 'Sizes', [-1 20 -1]);
uiextras.Empty('Parent', z);
set(z, 'Sizes', [-1 20 -1]);
g.SelectedChild = 1;
Comment only