Hi,
I am trying to implement the AdvSmoothStepControl in a sequencial process, where the use is not allowed to move back a step once the step has been completed.
How can I access the state of a step? I want to implement something like the following, but cannot seems to find the property I need to access.
procedure TformMain.assStepStepClick(Sender: TObject;
StepIndex: Integer; StepMode: TStepMode);
begin
if assStep.StepActions[StepIndex-1].Processed then ShowMessage('Cannot move back in the process');
...
end;
Regards
Marius
AdvSmoothStepControl.ActiveStep points to the current active step. That means that any step before was processed and steps after are unprocessed. So, you could compare the step index to ActiveStep to decide whether it was processed or not.
Hello Bruno,
Thank you for the reply.
If I use that logic though, it seems that it will never be caught, as when the user clicks on the next process block the ActiveStep will be whatever he has clicked, and therefor I have nothing to compare with. Active step becomes the one the user has just clicked on. Sure I can declare some variable in my program and record the last step that was successfully processed and compare to that, but I want to make sure that I'm not missing some built in functionality of the component itself.
If I modify my code to try using the following strategy:
procedure TformMain.assStepStepClick(Sender: TObject;
StepIndex: Integer; StepMode: TStepMode);
begin
if StepIndex=0 then
begin
if assStep.StepActions[StepIndex].Tag = 1 then
begin
ShowMessage('Cannot Move Backwards in Process');
end
else
begin
assStep.StepActions[StepIndex].Tag := 1;
end;
end
else
begin
if assStep.StepActions[StepIndex].Tag = 1 then
begin
ShowMessage('Cannot Move Backwards in Process');
end
else if assStep.StepActions[StepIndex-1].Tag = 0 then
begin
ShowMessage('Please process in a Sequential manner');
end
else
begin
assStep.StepActions[StepIndex].Tag := 1;
end;
end;
end;
How can I set the focus back to the step that was highlighted just before the user has clicked on one of the process blocks?
Regards
Marius
You can save the ActiveStep propery in a global variable and compare with the global variable instead before setting it with the ActiveStep property. This functionality is currently not built-in
Pieter Scheldeman2011-03-21 03:52:46
Hello Pieter,
Thanks for clarrifying.
Just one more question, how can I get the AdvSmoothStepControl to update so that the indicated step is the step the user is actually supposed to be processing? In other words, set the focus to the ActiveStep?
Regards
Marius
There is no possibility to set the focus to the activestep, as the focus is set on the control (each step is no separate control). There is currently no visible indication as the focus must be set to the active step and there are different styles to be covered.
Thank you Pieter