Comments on: uigetfile/uiputfile customizations https://undocumentedmatlab.com/blog_old/uigetfile-uiputfile-customizations Charting Matlab's unsupported hidden underbelly Mon, 07 Jun 2021 16:25:14 +0000 hourly 1 https://wordpress.org/?v=4.4.1 By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/uigetfile-uiputfile-customizations#comment-478462 Tue, 21 May 2019 09:51:33 +0000 https://undocumentedmatlab.com/?p=6728#comment-478462 @Jafa – the simplest way to add buttons is to adapt the Matlab source-code of the uigetfile_with_preview utility (around line #95) by adding Matlab uicontrols in the preview panel. Modifying the Java component (JFileChooser) would be more difficult.

]]>
By: Jafahttps://undocumentedmatlab.com/blog_old/uigetfile-uiputfile-customizations#comment-476931 Sat, 04 May 2019 18:25:39 +0000 https://undocumentedmatlab.com/?p=6728#comment-476931 Hello Yair,

thanks a lot for your helpful work!

Regarding uigetfile customizations, I am curious if there is the possibility of having multiple buttons (in my case I am looking for a 3rd button).

Thanks for your Reply!

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/uigetfile-uiputfile-customizations#comment-403480 Wed, 22 Mar 2017 09:16:40 +0000 https://undocumentedmatlab.com/?p=6728#comment-403480 @ODJAPO – well, the javax.swing.JFileChooser and com.mathworks.hg.util.dFileChooser classes have a setApproveButtonText() method that you can use for this:

hFig = figure('Name','Select directory', 'NumberTitle','off');
jfs = javaObjectEDT('com.mathworks.hg.util.dFileChooser');  % or: com.mathworks.hg.util.dFileChooser
[hjfs,hContainer] = javacomponent(jfs, [0,0,hFig.Position(3:4)], hFig);
hjfs.setApproveButtonText('Set directory');  % or: set(hjfs,'ApproveButtonText','Set directory')

You can edit my uigetfile_with_preview.m utility (which is referenced in the main article text above) accordingly. I do not advise modifying Matlab’s builtin uigetdir function directly.

]]>
By: ODJAPOhttps://undocumentedmatlab.com/blog_old/uigetfile-uiputfile-customizations#comment-403358 Mon, 20 Mar 2017 06:35:32 +0000 https://undocumentedmatlab.com/?p=6728#comment-403358 Hello,

Is there an easy way to change the button name of a classic uigetfile windows as “set file directory” instead of “Open” ?

Thanks for your answer.

]]>