function dlgr=alexdlg(dmsg, b1,b2,b3) %ALEXDLG Open a dialog box % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global Uibgcolor ed sg dlgf dlgr dlgb1 dlgb2 dlgb3 qq qq=0; sg=dmsg; dlgr='Cancel'; if isempty(Uibgcolor) Uibgcolor=[.55 .55 .55]; end if nargin < 1 error('Too few input arguments.') end if nargin > 4 error('Too many input arguments.') end if nargin==1 b1='Yes';b2='No';b3='Cancel'; end if nargin==2 b2='No';b3='Cancel'; end if nargin==3 b3='Cancel'; end pos=[0 0 0 0]; c=screencenter; pos(1)=c(1)-230; pos(2)=c(2)-120; pos(3)=460; pos(4)=240; dlgf=figure('name', 'Dialog',... 'Resize', 'off',... 'NumberTitle', 'off',... 'Position', pos,... 'Color', Uibgcolor); ed=uicontrol('style', 'edit',... 'units', 'normalized',... 'pos', [0.03 0.4 0.94 0.55],... 'min', 1,... 'max', 10,... 'horiz', 'center',... 'string', dmsg,... 'Callback', 'global ed sg;set(ed, ''string'', sg);'); uicontrol('style', 'frame',... 'units', 'normalized',... 'pos', [0.03 0.05 0.94 0.28],... 'background', Uibgcolor); dlgb1=uicontrol('style', 'push',... 'units', 'normalized',... 'pos', [0.1 0.1 0.2 0.15],... 'horiz', 'center',... 'string', b1,... 'Callback', 'global qq dlgb1 dlgr;dlgr=get(dlgb1, ''string'');qq=1;'); dlgb2=uicontrol('style', 'push',... 'units', 'normalized',... 'pos', [0.4 0.1 0.2 0.15],... 'horiz', 'center',... 'string', b2,... 'Callback', 'global qq dlgb2 dlgr;dlgr=get(dlgb2, ''string'');qq=1;'); dlgb3=uicontrol('style', 'push',... 'units', 'normalized',... 'pos', [0.7 0.1 0.2 0.15],... 'horiz', 'center',... 'string', b3,... 'Callback', 'global qq dlgb3 dlgr;dlgr=get(dlgb3, ''string'');qq=1;'); while qq==0 if ~figflag('Dialog', 0); return; end end close(dlgf); return;