You are on page 1of 3

------------------------------------------------------------------------

--
-- Copyright 1974 to current year. AVEVA Solutions Limited and its subsidiaries.
All rights reserved in original code only.
--
-- File: aidindex.pmlfrm
-- Type: Form Definition
-- Group: Aid element handlers
-- Keyword: AID
-- Module: common
-- Replaces:
--
-- Author: N.Holmes
-- Created: Mon Dec 15 18:48:11 WAT 1997
--
--
-- Description:
-- Index for aid lines.
--
------------------------------------------------------------------------
--
-- Methods defined:
--
-- Method call Return Description
-- =========== ====== ===========
-- initialise() - Initialisation for form
-- load() - Display currently defined
groups
-- remove() - Display currently defined
groups
--
------------------------------------------------------------------------

-- Define form
setup form !!aidIndex

!!aidIndex.formTitle = 'Aid Number Index'


!!aidIndex.iconTitle = 'AidIndex'
!!aidIndex.callback = '!this.initialise()'
!!aidIndex.formRevision = ' $Revision: 1.8 $ '

-- Body of form definition


path down

-- List of Aid Groups


list .numbers 'Numbers' at xmin y1 width 50 lines 10

-- Dismiss
button .dismiss 'Dismiss' at xmax form-size ymax ok

-- reload
button .reload 'Re-Load' at xmax.numbers-size ymin.numbers-0.6 callback '!
this.load()'

-- Remove from system


path left
button .remove 'Remove' callback '!this.remove()'

-- Shown Before
member .shownBefore is BOOLEAN
_shownBefore = false

exit
-- End of form definition for !!aidIndex

------------------------------------------------------------------------
--
-- Method: initialise
--
-- Description:
-- Initialisation for form
--
-- Method Type: Function/Procedure
-- Arguments:
-- [#] [R/RW] [Data Type] [Description]
-- Return:
-- [Data Type] [Description]
--
------------------------------------------------------------------------

-- Define method
define method .initialise()

!this.load()

endmethod
-- End of method definition for .initialise()

------------------------------------------------------------------------
--
-- Method: load
--
-- Description:
-- Display currently defined groups
--
-- Method Type: Function/Procedure
-- Arguments:
-- [#] [R/RW] [Data Type] [Description]
-- Return:
-- [Data Type] [Description]
--
------------------------------------------------------------------------

-- Define method
define method .load()

-- Initialise Variables
!displayText = ARRAY()
!replaceText = ARRAY()

-- Load all entries into form (


do !i indices !!aidNumbers.numbers

-- Display information about object associated with number


if(!!aidNumbers.numbers[!i].objectType() eq 'STRING') then
!string = !!aidNumbers.numbers[!i]

-- Run .string method on object


else
!string = !!aidNumbers.numbers[!i].string()
-- Handle no .string method and use object type
handle any
!string = !!aidNumbers.numbers[!i].objectType()
endhandle

-- Any return giving a null string


if(!string.empty()) then
!string = !!aidNumbers.numbers[!i].objectType()
endif

endif

!displayText[!i] = ' ' & !i.string() & ' ' & !string
!replaceText[!i] = !i.string()
enddo

-- Write to form
!this.numbers.dText = !displayText
!this.numbers.rText = !replaceText

endmethod
-- End of method definition for .load()

------------------------------------------------------------------------
--
-- Method: remove
--
-- Description:
-- Display currently defined groups
--
-- Method Type: Function/Procedure
-- Arguments:
-- [#] [R/RW] [Data Type] [Description]
-- Return:
-- [Data Type] [Description]
--
------------------------------------------------------------------------

-- Define method
define method .remove()

!!aidNumbers.remove(!!aidIndex.numbers.selection('RTEXT').real())
handle any
endhandle
!this.load()

endmethod
-- End of method definition for .remove()

You might also like