Jump to content

How auto close showmessage dialog after 1 sec...


Ulugbek

Recommended Posts

Hi Ulugbek.
 
Well, for example, you can ...
uses ... uniGUIApplication ...
procedure ExtShowMessage(ATitle, AMessage: string; AMilliseconds: Cardinal);
procedure TMainForm.ExtShowMessage(ATitle, AMessage: string; AMilliseconds: Cardinal);
begin
  UniSession.AddJS('var mb = Ext.MessageBox.show({'+
                  'title:'''+ATitle+''','+
                  'msg: '''+AMessage+''','+
                  'icon: Ext.Msg.QUESTION,'+
                  'buttons: Ext.MessageBox.OK,'+
                  'closable: false,'+
                  'fn:function(btn) {}});'+
                  'setTimeout(function(){'+
                  'mb.close();}, '+IntToStr(AMilliseconds)+');');
end;

Use:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin  
  ExtShowMessage('Save Changes?', 'You are closing a tab that has unsaved changes. Would you like to save your changes?', 1000);
end;
Ext.Msg.INFO;
Ext.Msg.QUESTION;
Ext.Msg.WARNING;
Ext.Msg.ERROR;

http://www.sencha.com/forum/showthread.php?196717-Automatically-closing-MessageBox-Showing-differnt-boxes-based-on-success-error-store

 

http://dev.sencha.com/playpen/docs/output/Ext.MessageBox.html

 

 

Sincerely

 

 

 

  • Upvote 1
Link to comment
Share on other sites

I have treeview when after adding new record from showmodal form

some like

  form.showmodal(

      if res=1 then

      begin

          insert into table valus  

         execute

         tree items.clear

         add

         add child

         fullexpand;               ///this not work if i showmessage use then work

        showmessage ( 'Success Add',procedure

        fullexpand;  // THats work

 

)

 

So I want to automatically close without user action..

 

      end

 

)

Link to comment
Share on other sites

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...