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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...