Search Comments and Ratings

go

   
Date File Comment by Comment Rating
05 Nov 2014 Add Icons to GUI menus Adds icons to the main figure menu of a given GUI Author: Alexander Mering Roger GALLOU

Hi Alexander,
Thanks for this work .
I would like to make some changes to the code for its compatibility with R2014b.

a) - I have to change top_level_menu_handle by (which is available for < R2014b) :
top_level_menu_handles = findobj(GUI_handle, {'Type', 'uimenu', 'Parent', GUI_handle});

b) - Then I give my version about majors changes in function Loop_SubMenues (can certainly be improved):
==========================================
function Loop_SubMenues(JMenu, Menu_Children)
% recursively runs through the menu entries and adds the icon, if exists

if isempty(Menu_Children)
return
end

%% take care of seperators
% these change the positions
separator_state = get(Menu_Children, {'Separator'});
separator_state(strcmp(separator_state, 'off')) = {0};
separator_state(strcmp(separator_state, 'on')) = {1};

% sort position in ascending order

children_info = {Menu_Children, cell2mat(get(Menu_Children, 'Position')), cell2mat(separator_state)};
[~, iperm] = sort(children_info{2}, 1);
children_info{1} = children_info{1}(iperm);
children_info{2} = children_info{2}(iperm);
children_info{3} = children_info{3}(iperm);

children_info{3} = cumsum(children_info{3});

for num_entry=1:length(Menu_Children)
% pos_entry_java = children_info(num_entry, 2) + children_info(num_entry, 3) - 1; % java indexing
pos_entry_java = children_info{2}(num_entry) + children_info{3}(num_entry) - 1; % java indexing

try % Pour éviter :

AddIcon(javaObjectEDT(JMenu.getItem(pos_entry_java)), children_info{1}(num_entry))

% Recurse into submenues
Loop_SubMenues(javaObjectEDT(JMenu.getItem(pos_entry_java)), get(children_info{1}(num_entry), 'Children'))
catch
end
end

4
27 Mar 2014 Figures-menu adaption for standalone applications Create dockable figures for standalones and disable or remove menu items from the figures container Author: Alexander Mering Thierry Dalon

Instead of DTDocumentBar = javaObjectEDT(figures_frame.getRootPane.getLayeredPane.getComponent(1).getComponent(1).getComponent(0).getComponent(0).getComponent(1).getComponent(0));
one could use the great findjobj:
hDocumentButtons=findjobj(container,’class’,'DTDocumentBar$DocumentButton’);
or for Matlab >=R2012a:
hTabs=findjobj(container,’class’,'DTDocumentTabs$Tab’);

JMenuBar.updateUI shall be added to refresh the menus.

Comment only
27 Nov 2013 Add Icons to GUI menus Adds icons to the main figure menu of a given GUI Author: Alexander Mering Thierry Dalon

Idea is good. But implementation still contains some bugs. (Example gcf is used instead of input hfig)

Comment only
26 Nov 2013 Add Icons to GUI menus Adds icons to the main figure menu of a given GUI Author: Alexander Mering Dongwon

4
15 Nov 2012 Figures-menu adaption for standalone applications Create dockable figures for standalones and disable or remove menu items from the figures container Author: Alexander Mering Alexander Mering

Thanks Aurelien.
The main praise should go to Yair Altman how showed the route. I just discovered and removed the crashing items.

About the error: I extracted the functions from a larger project and forgot to rename the MousePressed Callback in the Callback_DockingFcn.

I made an update and changed
Cbrake_Callback_Diagrams_DockingFcn -> Callback_DockingFcn

Comment only
15 Nov 2012 Figures-menu adaption for standalone applications Create dockable figures for standalones and disable or remove menu items from the figures container Author: Alexander Mering Aurelien Queffurust

Nice submission . Starting the desktop from a deployead application is amazing!!).
Under R2012b , Windows XP in deployed mode , I get only once this error :
Undefined function or variable 'Cbrake_Callback_Diagrams_DockingFcn'.
Error in Callback_DockingFcn/@(source,event)Cbrake_Callback_Diagrams_DockingFcn

but if works as expected , I mean ... figures can be docked in deployed mode.
Thanks

4

Contact us