Form VL_SAM028: Short and Long Activity Visual Feedback

LANSA

Form VL_SAM028: Short and Long Activity Visual Feedback
Name: VL_SAM028

Description: The following RDMLX form shows some of the techniques that can be used to provide visual feedback to a user while your application is performing both short and long running activities Create and compile reusable component VL_SAM027 before attempting to create this component.
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM FORMPOSITION(ScreenCenter) HEIGHT(318) WIDTH(531);
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(1) HEIGHT(22) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(269) WIDTH(523);
DEFINE_COM CLASS(#VL_SAM027) NAME(#INFBAR) HEIGHT(16) LEFT(271) PARENT(#STBR_1) TABPOSITION(4) TABSTOP(False) TOP(4);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#LONGACT) CAPTION('Perform Long Running Activity') DISPLAYPOSITION(2) LEFT(152) PARENT(#COM_OWNER) TABPOSITION(2) TOP(208) WIDTH(193);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#SHORTACT) CAPTION('Perform Short Running Activity') DISPLAYPOSITION(3) LEFT(152) PARENT(#COM_OWNER) TABPOSITION(1) TOP(152) WIDTH(193);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#TEXT) CAPTION('This example form emulates visual feedback techniques that can be used during short and long running activities. It uses reusable part VL_SAM027 on its status bar.') DISPLAYPOSITION(4) HEIGHT(81) LEFT(72) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(24) VISUALSTYLE(#VS_LAREM) WIDTH(377);
EVTROUTINE handling(#com_owner.Initialize);
Set #com_owner caption(*component_desc);
Set #InfBar Busy(False);
ENDROUTINE ;
Subroutine ExtendedOp;
Begin_loop from(1) to(1500000);
End_Loop ;
EndRoutine ;
EVTROUTINE HANDLING(#SHORTACT.Click);
Set #InfBar Busy(True);
Execute ExtendedOp;
Set #InfBar Busy(False);
ENDROUTINE;
EVTROUTINE HANDLING(#LONGACT.Click);
Define #LoopCount RefFld(#Std_Num);
Set #InfBar Busy(True);
Begin_Loop From(1) To(10) Using(#LoopCount);
Change #Std_Num '#LoopCount * 10';
Set #InfBar ProgressPercent(#Std_Num);
Execute ExtendedOp;
End_Loop;
Set #InfBar Busy(False);
Message 'Long running activity completed';
ENDROUTINE;
END_COM ;