Ulugbek Posted September 22, 2013 Share Posted September 22, 2013 Hi I need help How auto close showmessage dialog after 1 sec... Link to comment Share on other sites More sharing options...
Sherzod Posted September 22, 2013 Share Posted September 22, 2013 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 1 Link to comment Share on other sites More sharing options...
Ulugbek Posted September 23, 2013 Author Share Posted September 23, 2013 big thanks will try Link to comment Share on other sites More sharing options...
Ulugbek Posted September 23, 2013 Author Share Posted September 23, 2013 How work some like as showmessage anonymous callback like this ShowMessage('Message-2', procedure(Res: Integer) begin UniMemo1.Lines.Add('Result-1: '+IntToStr(Res)); end ); Link to comment Share on other sites More sharing options...
Sherzod Posted September 23, 2013 Share Posted September 23, 2013 Hi Ulugbek! I'm sorry, can you describe in detail what is needed such functionality? That is, the dialog is closed after a certain time and the procedure then can be performed... Sincerely... Link to comment Share on other sites More sharing options...
Ulugbek Posted September 23, 2013 Author Share Posted September 23, 2013 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 More sharing options...
Sherzod Posted September 25, 2013 Share Posted September 25, 2013 Hi Ulugbek. I don't know why, don't works fullexpand; Maybe before calling fullexpand, put a 1 second delay sleep(1000); // or a little more Maybe it's not the best solution, but try ... Best regards... Link to comment Share on other sites More sharing options...
Ulugbek Posted September 26, 2013 Author Share Posted September 26, 2013 Ok I will try I don't Know why But if call by buttonclick that work Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now