function AxCtl = AArView
if nargout ~= 1
    error('Usage view_ctl = AArView');
end

persistent view_ctl

% Size and configure gcf figure window
set(gcf,'Position',[176,351,752,519]);
set(gca,'Visible','off');
set(gcf,'Name','AArView');

% Create button controls
bOpen = uicontrol('Style','pushbutton',...
    'Position',[10, 40, 64, 20],'String','Open');
set(bOpen,'Callback',@OnOpen);
bCopy = uicontrol('Style','pushbutton',...
    'Position',[10, 10, 64, 20],'String','Copy');
set(bCopy,'Callback',@OnCopy);

% Create UBeamAfx ActiveX control from UBAfxP.ocx library
view_ctl = actxcontrol('UBAfxP.UBeamAfx',[97,0,655,519],gcf)
% Connect to figure window resize callback
set(gcf,'ResizeFcn',@OnResize);
% return control handle
AxCtl = view_ctl;

% Button control callbacks
function OnOpen (a, b)
    view_ctl.OpenWaveDlg;
end

function OnCopy (a, b)
    view_ctl.CopytoClipboard;
end

% Figure window resize callback
function OnResize (a, b)
    fpos = get(a,'Position');
    cpos = view_ctl.move;
    cpos(3) = fpos(3) - cpos(1);
    cpos(4) = fpos(4);
    view_ctl.move(cpos);
end

end
