You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Grid Column - LostFocusAccept Event

LostFocusAccept happens when item gets focused

Member of Grid Column (PRIM_GDCL)

Parameters

Name

Type

Data Type

Description

Accept

*Both

Boolean

Set to false to prevent the event from proceeding

Reason

*Input

Enumeration

Action that triggered the event

Details

The LostFocusAccept event is triggered immediately before the LostFocus event.

It is not a replacement for the LostFocus event, instead providing an opportunity for focus processing to be interrupted.

Set the Accept parameter to False to prevent focus changing.

Example

In this example, focus can only be moved from the first column if the check box is checked.

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(794) Clientheight(367) Componentversion(2) Top(227) Left(199) Layoutmanager(#TableLayout1)
 
   Define_Com Class(#PRIM_TBLO) Name(#TableLayout1)
   Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#TableLayout1)
   Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#TableLayout1) Height(1.78)
   Define_Com Class(#PRIM_TBLO.Row) Name(#Row2) Displayposition(2) Parent(#TableLayout1) Height(40) Units(Pixels)
   Define_Com Class(#PRIM_TBLO.Item) Name(#GridItem1) Column(#Column1) Manage(#Grid) Parent(#TableLayout1) Row(#Row1)
   Define_Com Class(#PRIM_TBLO.Item) Name(#AllowFocusChangeItem1) Manage(#AllowFocusChange) Parent(#TableLayout1) Row(#Row2) Sizing(None) Column(#Column1) Alignment(CenterLeft)
 
   Define_Com Class(#PRIM_GRID) Name(#Grid) Captionnoblanklines(True) Columnscroll(False) Componentversion(1) Displayposition(1) Left(0) Parent(#COM_OWNER) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(1) Top(0) Height(327) Width(794) Tabbingstyle(AroundGrid) Columnbuttonheight(22) Rowheight(22)
   Define_Com Class(#PRIM_GDCL) Name(#GridColumn1) Displayposition(1) Parent(#Grid) Source(#EMPNO) Width(14)
   Define_Com Class(#PRIM_GDCL) Name(#GridColumn2) Displayposition(2) Parent(#Grid) Source(#SURNAME)
   Define_Com Class(#PRIM_GDCL) Name(#GridColumn3) Displayposition(3) Parent(#Grid) Source(#GIVENAME)
   Define_Com Class(#PRIM_GDCL) Name(#GridColumn4) Displayposition(4) Parent(#Grid) Source(#ADDRESS1)
   Define_Com Class(#PRIM_GDCL) Name(#GridColumn5) Displayposition(5) Parent(#Grid) Source(#ADDRESS2)
   Define_Com Class(#PRIM_GDCL) Name(#GridColumn6) Displayposition(6) Parent(#Grid) Source(#ADDRESS3)
 
   Define_Com Class(#PRIM_CKBX) Name(#AllowFocusChange) Caption('Allow Focus Change?') Displayposition(2) Left(0) Marginleft(2) Parent(#COM_OWNER) Tabposition(2) Top(335) Width(161) Buttonstate(Checked)
 
   Evtroutine Handling(#Com_Owner.CreateInstance)
 
      Select Fields(#Grid) From_File(pslmst)
 
         Add_Entry To_List(#Grid)
 
      Endselect
 
   Endroutine
 
      Evtroutine Handling(#GridColumn1.LostFocusAccept) Accept(#Accept)
 
         #Accept := (#AllowFocusChange.buttonState = Checked)
 
      Endroutine
 
End_Com

See also

All Component Classes
Technical Reference

  • No labels