Code covered by the BSD License  

Highlights from
Icons Toolbox

image thumbnail
from Icons Toolbox by Thomas Montagnon
Set of tool for GUI icons/images manipulation

ico_disp_gui_build(hParent)
function handles = ico_disp_gui_build(hParent)
% ICO_DISP_GUI_BUILD
%-------------------------------------------------------------------------------
% File name   : ico_disp_gui_build.m          
% Generated on: 21-Mar-2007 15:24:32          
% Description :
%-------------------------------------------------------------------------------


% --- PANELS -------------------------------------
handles.PaIcoFile = uipanel(	'Parent', hParent, ...
	'Tag', 'PaIcoFile', ...
	'Units', 'pixels', ...
	'Position', [10 349 540 62], ...
	'BackgroundColor', [0.937 0.937 0.937], ...
	'Title', '');

% --- STATIC TEXTS -------------------------------------
handles.StIcoFileTitle = uicontrol(	'Parent', handles.PaIcoFile, ...
	'Tag', 'StIcoFileTitle', ...
	'Style', 'text', ...
	'Units', 'pixels', ...
	'Position', [0 45 538 15], ...
	'FontWeight', 'bold', ...
	'ForegroundColor', [1 1 1], ...
	'BackgroundColor', [0 0.251 0.502], ...
	'String', '  Icon File', ...
	'HorizontalAlignment', 'left');

% --- PUSHBUTTONS -------------------------------------
handles.PbBrowse = uicontrol(	'Parent', handles.PaIcoFile, ...
	'Tag', 'PbBrowse', ...
	'Style', 'pushbutton', ...
	'Units', 'pixels', ...
	'Position', [502 9 25 25], ...
	'String', '...', ...
	'Callback', @PbBrowse_Callback);

% --- EDIT TEXTS -------------------------------------
handles.EdIcoFile = uicontrol(	'Parent', handles.PaIcoFile, ...
	'Tag', 'EdIcoFile', ...
	'Style', 'edit', ...
	'Units', 'pixels', ...
	'Position', [13 10 480 21], ...
	'BackgroundColor', [1 1 1], ...
	'String', '', ...
	'HorizontalAlignment', 'left');

%-------------------------------------------------------------------------------
	function PbBrowse_Callback(hObject,evendata)

    % Ask User to choose an icons' file
    [fileName,filePath] = uigetfile('*.mat','Choose a MAT File');
    if isequal(fileName,0)
      return
    end
    fileName = fullfile(filePath,fileName);
    set(handles.EdIcoFile,'String',fileName)
    
    ico_disp(fileName);

	end

end

Contact us at files@mathworks.com