Who even knows at this point
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default)
|
||||
%QUESTDLG Question dialog box.
|
||||
% ButtonName = QUESTDLG(Question) creates a modal dialog box that
|
||||
% ButtonName=QUESTDLG(Question) creates a modal dialog box that
|
||||
% automatically wraps the cell array or string (vector or matrix)
|
||||
% Question to fit an appropriately sized window. The name of the
|
||||
% button that is pressed is returned in ButtonName. The Title of
|
||||
% the figure may be specified by adding a second string argument:
|
||||
%
|
||||
% ButtonName = questdlg(Question, Title)
|
||||
% ButtonName=questdlg(Question, Title)
|
||||
%
|
||||
% Question will be interpreted as a normal string.
|
||||
%
|
||||
@@ -17,7 +17,7 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default)
|
||||
% This can be changed by adding a third argument which specifies the
|
||||
% default Button:
|
||||
%
|
||||
% ButtonName = questdlg(Question, Title, 'No')
|
||||
% ButtonName=questdlg(Question, Title, 'No')
|
||||
%
|
||||
% Up to 3 custom button names may be specified by entering
|
||||
% the button string name(s) as additional arguments to the function
|
||||
@@ -26,7 +26,7 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default)
|
||||
% setting DEFAULT to the same string name as the button you want
|
||||
% to use as the default button:
|
||||
%
|
||||
% ButtonName = questdlg(Question, Title, Btn1, Btn2, DEFAULT);
|
||||
% ButtonName=questdlg(Question, Title, Btn1, Btn2, DEFAULT);
|
||||
%
|
||||
% where DEFAULT is set to Btn1. This makes Btn1 the default answer.
|
||||
% If the DEFAULT string does not match any of the button string names,
|
||||
@@ -35,7 +35,7 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default)
|
||||
% To use TeX interpretation for the Question string, a data
|
||||
% structure must be used for the last argument, i.e.
|
||||
%
|
||||
% ButtonName = questdlg(Question, Title, Btn1, Btn2, OPTIONS);
|
||||
% ButtonName=questdlg(Question, Title, Btn1, Btn2, OPTIONS);
|
||||
%
|
||||
% The OPTIONS structure must include the fields Default and Interpreter.
|
||||
% Interpreter may be 'none' or 'tex' and Default is the default button
|
||||
@@ -46,7 +46,7 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default)
|
||||
%
|
||||
% Example:
|
||||
%
|
||||
% ButtonName = questdlg('What is your favorite color?', ...
|
||||
% ButtonName=questdlg('What is your favorite color?', ...
|
||||
% 'Color Question', ...
|
||||
% 'Red', 'Green', 'Blue', 'Green');
|
||||
% switch ButtonName,
|
||||
@@ -72,7 +72,7 @@ if nargin<1
|
||||
end
|
||||
|
||||
Interpreter='none';
|
||||
Question = dialogCellstrHelper(Question);
|
||||
Question=dialogCellstrHelper(Question);
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%
|
||||
%%% General Info. %%%
|
||||
@@ -109,10 +109,10 @@ end
|
||||
%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%% Create QuestFig %%%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FigPos = get(0,'DefaultFigurePosition');
|
||||
FigPos(3) = 267;
|
||||
FigPos(4) = 70;
|
||||
FigPos = getnicedialoglocation(FigPos, get(0,'DefaultFigureUnits'));
|
||||
FigPos =get(0,'DefaultFigurePosition');
|
||||
FigPos(3)=267;
|
||||
FigPos(4)= 70;
|
||||
FigPos =getnicedialoglocation(FigPos, get(0,'DefaultFigureUnits'));
|
||||
|
||||
QuestFig=dialog( ...
|
||||
'Visible' ,'off' , ...
|
||||
@@ -164,7 +164,7 @@ if NumButtons > 1
|
||||
BtnWidth=max(BtnWidth,BtnExtent(3)*btnMargin);
|
||||
end
|
||||
end
|
||||
BtnHeight = max(BtnHeight,BtnExtent(4)*btnMargin);
|
||||
BtnHeight=max(BtnHeight,BtnExtent(4)*btnMargin);
|
||||
|
||||
delete(ExtControl);
|
||||
|
||||
@@ -198,36 +198,36 @@ MsgTxtForeClr=Black;
|
||||
MsgTxtBackClr=get(QuestFig,'Color');
|
||||
|
||||
CBString='uiresume(gcbf)';
|
||||
DefaultValid = false;
|
||||
DefaultWasPressed = false;
|
||||
BtnHandle = cell(NumButtons, 1);
|
||||
DefaultButton = 0;
|
||||
DefaultValid=false;
|
||||
DefaultWasPressed=false;
|
||||
BtnHandle=cell(NumButtons, 1);
|
||||
DefaultButton=0;
|
||||
|
||||
% Check to see if the Default string passed does match one of the
|
||||
% strings on the buttons in the dialog. If not, throw a warning.
|
||||
for i = 1:NumButtons
|
||||
for i=1:NumButtons
|
||||
switch i
|
||||
case 1
|
||||
ButtonString=Btn1;
|
||||
ButtonTag='Btn1';
|
||||
if strcmp(ButtonString, Default)
|
||||
DefaultValid = true;
|
||||
DefaultButton = 1;
|
||||
DefaultValid=true;
|
||||
DefaultButton=1;
|
||||
end
|
||||
|
||||
case 2
|
||||
ButtonString=Btn2;
|
||||
ButtonTag='Btn2';
|
||||
if strcmp(ButtonString, Default)
|
||||
DefaultValid = true;
|
||||
DefaultButton = 2;
|
||||
DefaultValid=true;
|
||||
DefaultButton=2;
|
||||
end
|
||||
case 3
|
||||
ButtonString=Btn3;
|
||||
ButtonTag='Btn3';
|
||||
if strcmp(ButtonString, Default)
|
||||
DefaultValid = true;
|
||||
DefaultButton = 3;
|
||||
DefaultValid=true;
|
||||
DefaultButton=3;
|
||||
end
|
||||
end
|
||||
|
||||
@@ -243,7 +243,7 @@ for i = 1:NumButtons
|
||||
end
|
||||
|
||||
if ~DefaultValid
|
||||
warnstate = warning('backtrace','off');
|
||||
warnstate=warning('backtrace','off');
|
||||
warning('MATLAB:QUESTDLG:stringMismatch','Default string does not match any button string name.');
|
||||
warning(warnstate);
|
||||
end
|
||||
@@ -278,7 +278,7 @@ texthandle=text( ...
|
||||
'Tag' ,'Question' ...
|
||||
);
|
||||
|
||||
textExtent = get(texthandle, 'Extent');
|
||||
textExtent=get(texthandle, 'Extent');
|
||||
|
||||
% (g357851)textExtent and extent from uicontrol are not the same. For window, extent from uicontrol is larger
|
||||
%than textExtent. But on Mac, it is reverse. Pick the max value.
|
||||
@@ -395,7 +395,7 @@ end
|
||||
switch(evd.Key)
|
||||
case {'return','space'}
|
||||
if DefaultValid
|
||||
DefaultWasPressed = true;
|
||||
DefaultWasPressed=true;
|
||||
uiresume(gcbf);
|
||||
end
|
||||
case 'escape'
|
||||
@@ -407,7 +407,7 @@ end
|
||||
switch(evd.Key)
|
||||
case {'return'}
|
||||
if DefaultValid
|
||||
DefaultWasPressed = true;
|
||||
DefaultWasPressed=true;
|
||||
uiresume(gcbf);
|
||||
end
|
||||
case 'escape'
|
||||
|
||||
Reference in New Issue
Block a user