Ulugbek Posted September 22, 2013 Posted September 22, 2013 Hi I need help How auto close showmessage dialog after 1 sec... Quote
Sherzod Posted September 22, 2013 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 Quote
Ulugbek Posted September 23, 2013 Author 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 ); Quote
Sherzod Posted September 23, 2013 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... Quote
Ulugbek Posted September 23, 2013 Author 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 ) Quote
Sherzod Posted September 25, 2013 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... Quote
Ulugbek Posted September 26, 2013 Author Posted September 26, 2013 Ok I will try I don't Know why But if call by buttonclick that work Quote
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.