Note that there are some explanatory texts on larger screens.

plurals
  1. POCorrectly using TAniIndicator in firemonkey mobile dev for wait for processing
    primarykey
    data
    text
    <p>I am using Delphi XE-5 (Firemonkey Mobile Application)</p> <p>I am trying to get the TAniIndicator to work, by displaying during my long processing. I have a TAniIndicator (AniIndi) on my main form, but it does not spin. It displays correctly, but does not spin.</p> <pre><code>begin Loading:= True; AniIndi.Visible:= True; AniIndi.Enabled:= True; UpdateAll; Application.ProcessMessages; //do my processsing here Loading:= False; AniIndi.Enabled:= False; AniIndi.Visible:= False; UpdateAll; Application.ProcessMessages; end; </code></pre> <p>//EDIT BASED ON REMY's ANSWER</p> <pre><code>TLoadThread = class(TThread) public Config: Boolean; constructor Create(const aConfig: Boolean); reintroduce; protected procedure DoProcessing; procedure Execute; Override; end; var loading: Boolean = false; zLThread: TLoadThread = nil; constructor TLoadThread.Create(const aConfig: Boolean); begin inherited Create(true); Config:= aConfig; end; procedure TLoadThread.DoProcessing; var begin //do processing here and update main form end; procedure TLoadThread.Execute; begin FreeOnTerminate:= true; Synchronize(DoProcessing); end; procedure TfrmMain.FormActivate(Sender: TObject); begin zLThread:= TLoadThread.Create(True, Host, NamePath, Config, Port); zLThread.OnTerminate := ThreadTerminated; zLThread.Start; Loading := True; AniIndi.Visible := True; AniIndi.Enabled := True; UpdateAll; end; procedure TfrmMain.ThreadTerminated(Sender: TObject); begin zLThread := nil; Loading := False; AniIndi.Enabled := False; AniIndi.Visible := False; UpdateAll; end; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload