|
16 | 16 | % setStyle - Modify a specified style property.
|
17 | 17 | % setTimeout - Override the default timeout for dojo commands, for a specific uifigure.
|
18 | 18 | % textAlign - Modify text alignment.
|
| 19 | + % unlockUIFig - Allow the uifigure to be opened using an external browser. |
19 | 20 | % waitForFigureReady - A blocking method that only returns after the uifigure is fully loaded.
|
20 | 21 | %
|
21 | 22 | % See README.md for detailed documentation and examples.
|
@@ -106,6 +107,8 @@ function fontWeight(uiElement, weight)
|
106 | 107 | % A method for dumping the HTML code of a uifigure.
|
107 | 108 | % Intended for R2017b (and onward?) where the CEF url cannot be simply opened in
|
108 | 109 | % an external browser.
|
| 110 | + % Mostly irrelevant for UIFigures as of the introduction of mlapptools.unlockUIFig(...), |
| 111 | + % but can be useful for other non-uifigure webwindows. |
109 | 112 | %% Obtain webwindow handle:
|
110 | 113 | if isa(hFigOrWin,'matlab.ui.Figure')
|
111 | 114 | win = mlapptools.getWebWindow(hFigOrWin);
|
@@ -341,6 +344,16 @@ function textAlign(uiElement, alignment)
|
341 | 344 |
|
342 | 345 | mlapptools.setStyle(win, 'textAlign', alignment, ID_struct);
|
343 | 346 | end % textAlign
|
| 347 | + |
| 348 | + function unlockUIFig(hUIFig) |
| 349 | + % This method allows the uifigure to be opened in an external browser, |
| 350 | + % as was possible before R2017b. |
| 351 | + if verLessThan('matlab','9.3') |
| 352 | + % Do nothing, since this is not required pre-R2017b. |
| 353 | + else |
| 354 | + struct(hUIFig).Controller.ProxyView.PeerNode.setProperty('hostType','""'); |
| 355 | + end |
| 356 | + end % unlockUIFig |
344 | 357 |
|
345 | 358 | function win = waitForFigureReady(hUIFig)
|
346 | 359 | % This blocking method waits until a UIFigure and its widgets have fully loaded.
|
|
0 commit comments