trey Posted December 20, 2012 Share Posted December 20, 2012 Put on form UniPanel1: TUniPanel; UniButton1: TUniButton; UniProgressBar1: TUniProgressBar; UniLabel1: TUniLabel; Run on WebBrowser uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIForm, uniLabel, uniProgressBar, uniButton, uniGUIBaseClasses, uniPanel; type TMainForm = class(TUniForm) UniPanel1: TUniPanel; UniButton1: TUniButton; UniProgressBar1: TUniProgressBar; UniLabel1: TUniLabel; procedure UniFormCreate(Sender: TObject); procedure UniButton1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; function MainForm: TMainForm; implementation {$R *.dfm} uses uniGUIVars, MainModule, ServerModule, uniGUIServer; function MainForm: TMainForm; begin Result := TMainForm(UniMainModule.GetFormInstance(TMainForm)); end; procedure TMainForm.UniButton1Click(Sender: TObject); var i:integer; begin UniProgressBar1.Max:=100; UniPanel1.Visible:=true; // 1. why does not work? for i:=0 to 100 do begin sleep(10); UniLabel1.Text:=inttostr(i); // 2. why does not work? UniProgressBar1.Position:=i; // 3. why does not work? Application.ProcessMessages; // 4. why does not work? UniProgressBar1.Refresh; // 5. why does not work? UniProgressBar1.RePaint; // 6. why does not work? end; UniPanel1.Visible:=false; end; procedure TMainForm.UniFormCreate(Sender: TObject); begin UniServerModule.MainFormDisplayMode:=mfPage; UniPanel1.Visible:=false; end; initialization RegisterMainFormClass(TMainForm); end. I even tried to run the UniProgressBar1.Position in a new threads , but webform is dead when the cycle runs. Quote Link to comment Share on other sites More sharing options...
lema Posted December 20, 2012 Share Posted December 20, 2012 Please see the following: http://forums.unigui.com/index.php?/topic/1479-progressbar-multithreading-demo/ Quote Link to comment Share on other sites More sharing options...
trey Posted December 20, 2012 Author Share Posted December 20, 2012 Thanks for the link. but! Why should I write "bikes"? why asynchronous operation can not be achieved by the component itself? why methods Repaint, Refresh, in components when it does not work ? Quote Link to comment Share on other sites More sharing options...
thecrgrt Posted December 20, 2012 Share Posted December 20, 2012 Thanks for the link. but! Why should I write "bikes"? why asynchronous operation can not be achieved by the component itself? why methods Repaint, Refresh, in components when it does not work ? Those methods were for desktop mode, not a web. you need to remember this is a framework for dual UI mode. UniGUI is a fresh one, it's not a mature framework yet. This is its first step so you need to manage some action your-self. By the way, your question is a good idea. By a "Asynchronous" nature it is possible that every UniGUI component's methods can parallel send and receive ajax-request itself, but that needs more design and take more time to implement. Implement more web UI supported by ExtJS should be the first priority, IMO. Quote Link to comment Share on other sites More sharing options...
Luis Devis Posted August 18 Share Posted August 18 Have you tried by doing ?: Unisession.synchronize; Or UniPanel1.beginupdate; UniPanel1.Visible:=true; UniPanel1.endupdate; 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.