__property TComputeEvent OnCompute = {read = GetOnCompute, write = SetOnCompute};
Place the actual threading algorithm in this event.
TComputeEvent GetOnCompute();void SetOnCompute(const TComputeEvent &Value);The actual algorithm, that needs to be threaded or it's progress monitored, should be placed within this event. If TMtxProgressDialog::InternalLoop is true, this event will be called once for each iteration. Iteration count and range is defined with properties TMtxProgressDialog::Min, TMtxProgressDialog::Max, TMtxProgressDialog::Loops and a boolean property TMtxProgressDialog::InfiniteLoop. If TMtxProgressDialog::InfiniteLoop is set to True, the thread will be calling OnCompute event until Cancel property is set to True. If InternalLoop is false, then OnCompute is called only once. Note
OnCompute event is executed within a thread and all restrictions regarding the calls to VCL and not thread safe libraries apply to the code placed within the OnCompute event. Do not call Synchronize to update the progress indicators from within the OnCompute event. Use the OnProgressUpdate event which runs in the main thread and does not require a call to Synchronize procedure.