S_227FC

LANSA

S_227FC
* ===================================================================
*
* Component : S_227FC
* Type : Form
* Ancestor : PRIM_FORM
*
* Description : Using Visual Styles for a Grid - Entire Row
*
* Disclaimer : The following material is supplied as example material
* only. No warranty concerning this material or its use
* in any way whatsoever is expressed or implied.
*
* ===================================================================
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(293) Layoutmanager(#ATLM_1) Left(344) Top(164) Visualstyle(#VS_NORM) Width(438)

* ==========================
* Form Layout
* ==========================

Define_Com Class(#PRIM_GRID) Name(#EMP_GRID) Columnbuttonheight(18) Displayposition(1) Height(266) Left(0) Parent(#COM_OWNER) Rowheight(18) Showbuttonselection(True) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(1) Top(0) Width(430)
Define_Com Class(#PRIM_GDCL) Name(#GDCL_1) Displayposition(1) Parent(#EMP_GRID) Source(#GIVENAME) Width(38)
Define_Com Class(#PRIM_GDCL) Name(#GDCL_2) Displayposition(2) Parent(#EMP_GRID) Source(#SURNAME) Width(36)
Define_Com Class(#PRIM_GDCL) Name(#GDCL_3) Displayposition(3) Parent(#EMP_GRID) Source(#SALARY) Width(26)
Define_Com Class(#PRIM_ATLM) Name(#ATLM_1)
Define_Com Class(#PRIM_ATLI) Name(#ATLI_1) Attachment(Center) Manage(#EMP_GRID) Parent(#ATLM_1)

* ==========================================
* Flashing list, timer and style
* ==========================================

Define_Com Class(#PRIM_TIMR) Name(#FLASHTIMER) Interval(0)
Define Field(#ENTRY_NO) Reffld(#STD_NUM)
Def_List Name(#FLASHLIST) Fields(#ENTRY_NO) Type(*WORKING) Entrys(9999)
Define_Com Class(#PRIM_VS) Name(#NEXTSTYLE) Reference(*Dynamic)

* ==========================
* Handle form initialization
* ==========================

Evtroutine Handling(#COM_OWNER.Initialize) Options(*NOCLEARMESSAGES *NOCLEARERRORS)

* Populate the Grid

Select Fields(#EMP_GRID) From_File(PSLMST)

Add_Entry To_List(#EMP_GRID)

* If Salary > $75,000 set the row visual style to S_227VR

If Cond('#Salary > 75000')
Set Com(#Emp_Grid.CurrentItem) Visualstyle(#S_227VR)
Change Field(#ENTRY_NO) To('#EMP_GRID.CURRENTITEM.ENTRY')
Add_Entry To_List(#FLASHLIST)
Endif
Endselect

* Set the next style to be flashed and start the flash timer

Set_Ref Com(#NextStyle) To(#vs_Norm)

Set Com(#FlashTimer) Interval(1000)

Endroutine

* ================================
* Handle a tick of the flash timer
* ================================

Evtroutine Handling(#FlashTimer.Tick) Options(*NOCLEARMESSAGES *NOCLEARERRORS)

* Change all entries in the flash list to the next style

Selectlist Named(#FLASHLIST)
Get_Entry Number(#ENTRY_NO) From_List(#EMP_GRID)
Set Com(#Emp_Grid.CurrentItem) Visualstyle(#NextStyle)
Endselect

* Flip/Flop the next style to be used

If_Ref Com(#NextStyle) Is(*Equal_to #VS_Norm)
Set_Ref Com(#NextStyle) To(#S_227VR)
Else
Set_Ref Com(#NextStyle) To(#vs_Norm)
Endif

Endroutine

End_Com