petr.nehez Posted August 25, 2011 Share Posted August 25, 2011 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. Quote Link to comment Share on other sites More sharing options...
dionel1969 Posted August 25, 2011 Share Posted August 25, 2011 It is a bug. It happens with mtWarning, mtError and mtInformation. Quote Link to comment Share on other sites More sharing options...
petr.nehez Posted August 25, 2011 Author Share Posted August 25, 2011 OK, I thought it. I made a workaround by using of instance of TExtMessageBoxSingleton. Quote Link to comment Share on other sites More sharing options...
petr.nehez Posted August 25, 2011 Author Share Posted August 25, 2011 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. Quote Link to comment Share on other sites More sharing options...
petr.nehez Posted August 26, 2011 Author Share Posted August 26, 2011 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); Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 26, 2011 Administrators Share Posted August 26, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.