Code covered by the BSD License  

Highlights from
setFigDockGroup

5.0

5.0 | 4 ratings Rate this file 45 Downloads (last 30 days) File Size: 5.52 KB File ID: #16650
image thumbnail

setFigDockGroup

by

 

29 Sep 2007 (Updated )

Sets a figure's docking group container

| Watch this File

File Information
Description

setFigDockGroup sets a figure's (or list of figures') docking group container, enabling to dock figures to containers other than the default 'Figures' container (for example, to the 'Editor' group as shown in the screenshot, or to any new user-defined group, or even to another figure's button).

Syntax:
hGroup = setFigDockGroup(hFig, group)
hButton = setFigDockGroup(hFig, hButton)

Inputs:
hFig is an optional handle or list of handles. These are normally figure handles, but not necessarily: the handles' containing figures are automatically inferred and used. If hFig is not supplied, then the current figure handle (gcf) is assumed.

GROUP is either a group name (e.g., 'Editor', 'Figures', 'my group') or a group handle returned from a previous setFigDockGroup function call.

hButton is the handle of a uicontrol pushbutton on another figure. This button would typically be labeled "undock" or have an undocking icon. Note that the docked figure will be minimized to the target hButton - you will NOT be able to see the docked figure's contents in the target figure, only to undock it via the button. Docking into a figure panel will perhaps be added in some future version.

Outputs:
The returned hGroupContainer object allows access to many useful properties and callbacks. Type "get(hGroupContainer)" to see the full list.

See extended help within.

Warning:
This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7.4+, but use at your own risk!

Bugs and suggestions:
Please send to Yair Altman (altmany at gmail dot com)

Acknowledgements

This file inspired Dock And Undock Figures Into Groups.

MATLAB release MATLAB 7.4 (R2007a)
Other requirements Java
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
28 Feb 2014 Clemens Nyffeler

This function is awesome!

Apparently the dock group window remembers its last layout (i.e. how many tiles it has and where they are located).
Is it possible to control which tile a given figure goes into?

07 Jul 2013 Yair Altman

Jonathan - yes, this utility can indeed be used in deployed apps. If you need consulting help regarding docking, or Matlab in general, please contact me offline (altmany at gmail).

07 Jul 2013 Jonathan Lister

Can this be used in deployed applications?

25 Jun 2012 Brian B

This is exactly what I was searching for!

Feature requests:

1) add functionality to close these docked group windows groups! ('close all' doesn't do the trick, as the group container remains)

2) keep the grouped windows from populating Matlab's Desktop menu list (The drop down alongside File | Edit | Debug |... ). It seems to include every single grouped window I create :(

24 Jan 2010 almog shalom

Very nice!
Another useful function by Yair Altman.
On R2009a, JavaFrame still works, and I guess that when it won't work, there will be a replacement (I'm sure that Y. Altman will find it even it will be undocumented ;) )

14 Sep 2008 jun ziyang

Very Usefull!
But the figure JavaFrame property will be obsoleted after R2008a. Hope there is a way around.

06 Oct 2007 Dan Haeg

Great function.

Updates
23 May 2010

Enabled docking to a figure button (minimized), and undocking back from that figure button.

13 Oct 2011

Fix for R2011a

19 Nov 2012

Fixes for Macs

Contact us