Jump to content

Recommended Posts

Posted

Hi,

 

I'd like to show error message with red cross (if possible) with MessageDlg procedure but the shown dialog has still the title "Confirmation" although I pass 'mtError' parameter.

MessageDlg('AAA', mtError, [mbOK]);

Is there a bug?

 

Thanks.

post-269-0-49136200-1314257092_thumb.png

Posted

I have another question.

 

Can someone give me a solution how to pass a callback function to TExtMessageBoxSingleton's methods like Alert etc?

I'd like to have customized message dialogs with callbacks but I don't know how to do it.

 

Thanks.

Posted

Can someone give me a solution how to pass a callback function to TExtMessageBoxSingleton's methods like Alert etc?

I'd like to have customized message dialogs with callbacks but I don't know how to do it.

 

Nevermind, I've already found a solution which works:

      MF := UniApplication.UniMainModule.MainForm;
     if (MF <> nil) and (MF is TUniForm) and (TUniForm(MF).WebForm <> nil) then
     begin
       EF := TUniExtFormAccess(TUniForm(MF).WebForm);
       CBF := TCallbackExtFunction.Create(aCallback);
       CBF.FAjaxIntercept := EF.AjaxParamIntercept;
       CBF.FAjaxParamListIntercept := EF.AjaxParamListIntercept;
       CBF.Ajax('callback', ['ButtonID', '%0'], True);

...

procedure TCallbackExtFunction.HandleEvent(const AEventName: string);
var
 MR: Integer;
begin
 if SameText(AEventName, 'callback') then
 begin
   if Assigned(FCallback) then
   begin
     if (ButtonsDict = nil) or not ButtonsDict.TryGetValue(ParamAsString('ButtonID'), MR) then
       MR := mrNone;
     FCallback(MR);
   end;
   FCallback := nil;
 end
 else
   inherited;
end;

initialization
 ButtonsDict := TTextDictionary<Integer>.Create;
 ButtonsDict.AddOrSetValue('ok', mrOk);
 ButtonsDict.AddOrSetValue('cancel', mrCancel);
 ButtonsDict.AddOrSetValue('yes', mrYes);
 ButtonsDict.AddOrSetValue('no', mrNo);

  • Administrators
Posted

Hi,

 

I'd like to show error message with red cross (if possible) with MessageDlg procedure but the shown dialog has still the title "Confirmation" although I pass 'mtError' parameter.

MessageDlg('AAA', mtError, [mbOK]);

Is there a bug?

 

Thanks.

 

Fixed.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...