open-insight/LSL2/STPROC/GET_KEY_CONTROLS.txt
Infineon\StieberD 7762b129af pre cutover push
2024-09-04 20:33:41 -07:00

65 lines
2.0 KiB
Plaintext

Compile function Get_Key_Controls(Window)
************************************************************************************************
*
* This program is proprietary and is not to be used by or disclosed to others, nor is it to be
* copied without written permission from SRP Computer Solutions unless used exclusively within
* the context of the licensed user's proprietary application or within a deployed runtime
* generated by the licensed user
*
* Name : Get_Key_Controls
*
* Description: Returns a list of key controls for the window
*
* Notes :
*
* Parameters
* Window [in] -- The window needing the FOCUS change
* KeyList [out] -- @FM delimited list of key controls sorted in PART order
*
* History (Date, Initials, Notes)
* 09/11/99 dmb Original programmer
* 12/13/05 dmb Assigned Window to @Window if it is unassigned
*
************************************************************************************************
$insert APP_INSERTS
Declare function Get_Property
Declare subroutine V119
If Assigned(Window) else Window = @Window
* Get list of all controls
CtrlList = Get_Property(Window, "CTRLMAP")
Convert @FM to @RM in CtrlList
* Get field positions of all controls
PosList = Get_Property(CtrlList, Str("POS":@RM, Count(CtrlList, @RM)):"POS")
* Build list of keys
KeyList = ""
Loop
Locate "0" in PosList using @RM Setting Pos else Pos = 0
While Pos
KeyList := Field(CtrlList, @RM, Pos):@RM
PosList = Field(PosList, @RM, Pos+1, 999)
CtrlList = Field(CtrlList, @RM, Pos+1, 999)
Repeat
KeyList[-1, 1] = ""
NumKeyCtrls = Count(KeyList, @RM) + (KeyList NE "")
If NumKeyCtrls GT 1 then
Props = Str("PART":@RM, NumKeyCtrls-1):"PART"
Parts = Get_Property(KeyList, Props)
Convert @RM to @FM in KeyList
Convert @RM to @FM in Parts
Work = ""
For Loop = 1 to NumKeyCtrls
Work := Parts<Loop>:@FM:KeyList<Loop>:@RM
Next Loop
V119("S", "", "A", "R", Work, "")
For Loop = 1 to NumKeyCtrls
KeyList<Loop> = Field(Work, @RM, Loop)<2>
Next Loop
end
Return KeyList