Code: Select all
-- This script defines the behavior of your data grid's custom template. This behavior
-- only applies to 'forms' and not 'tables'.
on FillInData pDataArray
-- This message is sent when the Data Grid needs to populate
-- this template with the data from a record. pDataArray is an
-- an array containing the records data.
-- You do not need to resize any of your template's controls in
-- this message. All resizing should be handled in resizeControl.
-- Example:
set the visible of field "text_UserName_NewAccount" to true
set the visible of field "text_Age_NewAccount" to true
set the visible of field "text_FirstName_NewAccount" to true
set the visible of field "text_MiddleName_NewAccount" to true
set the visible of field "text_LastName_NewAccount" to true
set the visible of field "text_Password_NewAccount" to true
set the visible of field "text_ConfirmPassword_NewAccount" to true
set the visible of field "text_Email_NewAccount" to true
set the visible of field "text_ConfirmEmail_NewAccount" to true
set the visible of field "text_PhoneNumber_NewAccount" to true
set the visible of field "text_ConfirmPhoneNumber_NewAccount" to true
set the visible of field "text_SecurityQuestion1_NewAccount" to true
set the visible of field "text_SecurityQuestion2_NewAccount" to true
set the visible of field "text_Residence_NewAccount" to true
set the visible of field "text_City_NewAccount" to true
set the visible of field "text_State_NewAccount" to true
set the visible of field "text_ZipCode_NewAccount" to true
set the visible of field "text_Country_NewAccount" to true
set the visible of button "button_SignUp_Mentor_NewAccount" to true
set the text of field "field_UserName_NewAccount" of me to pDataArray["UserName"]
set the text of field "field_Age_NewAccount" of me to pDataArray["Age"]
set the text of field "field_FirstName_NewAccount" of me to pDataArray["FirstName"]
set the text of field "field_MiddleName_NewAccount" of me to pDataArray["MiddleName"]
set the text of field "field_LastName_NewAccount" of me to pDataArray["LastName"]
set the text of field "field_Password_NewAccount" of me to pDataArray["Password"]
set the text of field "field_ConfirmPassword_NewAccount" of me to pDataArray["ConfirmPassword"]
set the text of field "field_Email_NewAccount" of me to pDataArray["Email"]
set the text of field "field_ConfirmEmail_NewAccount" of me to pDataArray["ConfirmEmail"]
set the text of field "field_PhoneNumber_NewAccount" of me to pDataArray["PhoneNumber"]
set the text of field "field_ConfirmPhoneNumber_NewAccount" of me to pDataArray["ConfirmPhoneNumber"]
set the label of button "button_SecurityQuestion1_NewAccount" of me to pDataArray["SecurityQuestion1"]
set the text of field "field_SecurityQuestion1_NewAccount" of me to pDataArray["SecurityQuestion1Answer"]
set the label of button "button_SecurityQuestion2_NewAccount" of me to pDataArray["SecurityQuestion2"]
set the text of field "field_SecurityQuestion2Answer_NewAccount" of me to pDataArray["SecurityQuestion2Answer"]
set the label of button "button_Residence_NewAccount" of me to pDataArray["Residence"]
set the text of field "field_ResidenceAnswer_NewAccount" of me to pDataArray["ResidenceAnswer"]
set the text of field "field_City_NewAccount" of me to pDataArray["City"]
set the text of field "field_State_NewAccount" of me to pDataArray["State"]
set the text of field "field_ZipCode_NewAccount" of me to pDataArray["ZipCode"]
set the text of field "field_Country_NewAccount" of me to pDataArray["Country"]
end FillInData
on LayoutControl pControlRect
local theFieldRect
-- This message is sent when you should layout your template's controls.
-- This is where you resize the 'Background' graphic, resize fields and
-- position objects.
-- For fixed height data grid forms you can use items 1 through 4 of pControlRect as
-- boundaries for laying out your controls.
-- For variable height data grid forms you can use items 1 through 3 of pControlRect as
-- boundaries, expanding the height of your control as needed.
-- Example:
-- put the rect of field "text_UserName_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_UserName_NewAccount" of me to theFieldRect
-- put the rect of field "text_Age_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_Age_NewAccount" of me to theFieldRect
-- put the rect of field "text_FirstName_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_FirstName_NewAccount" of me to theFieldRect
-- put the rect of field "text_MiddleName_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_MiddleName_NewAccount" of me to theFieldRect
-- put the rect of field "text_LastName_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_LastName_NewAccount" of me to theFieldRect
-- put the rect of field "text_Password_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_Password_NewAccount" of me to theFieldRect
-- put the rect of field "text_ConfirmPassword_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_ConfirmPassword_NewAccount" of me to theFieldRect
-- put the rect of field "text_Email_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_Email_NewAccount" of me to theFieldRect
-- put the rect of field "text_ConfirmEmail_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_ConfirmEmail_NewAccount" of me to theFieldRect
-- put the rect of field "text_PhoneNumber_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_PhoneNumber_NewAccount" of me to theFieldRect
-- put the rect of field "text_ConfirmPhoneNumber_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_ConfirmPhoneNumber_NewAccount" of me to theFieldRect
-- put the rect of field "text_SecurityQuestion1_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_SecurityQuestion1_NewAccount" of me to theFieldRect
-- put the rect of field "text_SecurityQuestion2_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_SecurityQuestion2_NewAccount" of me to theFieldRect
-- put the rect of field "text_Residence_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_Residence_NewAccount" of me to theFieldRect
-- put the rect of field "text_City_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_City_NewAccount" of me to theFieldRect
-- put the rect of field "field_State_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_State_NewAccount" of me to theFieldRect
-- put the rect of field "text_ZipCode_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "text_ZipCode_NewAccount" of me to theFieldRect
-- put the rect of field "field_Country_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_Country_NewAccount" of me to theFieldRect
-- put the rect of field "field_UserName_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_UserName_NewAccount" of me to theFieldRect
-- put the rect of field "field_Age_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_Age_NewAccount" of me to theFieldRect
-- put the rect of field "field_FirstName_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_FirstName_NewAccount" of me to theFieldRect
-- put the rect of field "field_MiddleName_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_MiddleName_NewAccount" of me to theFieldRect
-- put the rect of field "field_LastName_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_LastName_NewAccount" of me to theFieldRect
-- put the rect of field "field_Password_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_Password_NewAccount" of me to theFieldRect
-- put the rect of field "field_ConfirmPassword_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_ConfirmPassword_NewAccount" of me to theFieldRect
-- put the rect of field "field_Email_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_Email_NewAccount" of me to theFieldRect
-- put the rect of field "field_ConfirmEmail_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_ConfirmEmail_NewAccount" of me to theFieldRect
-- put the rect of field "field_PhoneNumber_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_PhoneNumber_NewAccount" of me to theFieldRect
-- put the rect of field "field_ConfirmPhoneNumber_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_ConfirmPhoneNumber_NewAccount" of me to theFieldRect
-- put the rect of button "button_SecurityQuestion1_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of button "button_SecurityQuestion1_NewAccount" of me to theFieldRect
-- put the rect of field "field_SecurityQuestion1_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_SecurityQuestion1_NewAccount" of me to theFieldRect
-- put the rect of field "button_SecurityQuestion2_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "button_SecurityQuestion2_NewAccount" of me to theFieldRect
-- put the rect of field "field_SecurityQuestion2Answer_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_SecurityQuestion2Answer_NewAccount" of me to theFieldRect
-- put the rect of button "button_Residence_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of button "button_Residence_NewAccount" of me to theFieldRect
-- put the rect of field "field_ResidenceAnswer_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_ResidenceAnswer_NewAccount" of me to theFieldRect
-- put the rect of field "field_City_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_City_NewAccount" of me to theFieldRect
-- put the rect of field "field_State_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_State_NewAccount" of me to theFieldRect
-- put the rect of field "field_ZipCode_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_ZipCode_NewAccount" of me to theFieldRect
-- put the rect of field "field_Country_NewAccount" of me into theFieldRect
-- put item 3 of pControlRect - 5 into item 3 of theFieldRect
-- set the rect of field "field_Country_NewAccount" of me to theFieldRect
set the rect of graphic "Background" of me to pControlRect
end LayoutControl
on ResetData
-- Sent when data is being emptied because the control is no longer being used to display data
set the text of field "field_UserName_NewAccount" of me to empty
set the text of field "field_Age_NewAccount" of me to empty
set the text of field "field_FirstName_NewAccount" of me to empty
set the text of field "field_MiddleName_NewAccount" of me to empty
set the text of field "field_LastName_NewAccount" of me to empty
set the text of field "field_Password_NewAccount" of me to empty
set the text of field "field_ConfirmPassword_NewAccount" of me to empty
set the text of field "field_Email_NewAccount" of me to empty
set the text of field "field_ConfirmEmail_NewAccount" of me to empty
set the text of field "field_PhoneNumber_NewAccount" of me to empty
set the text of field "field_ConfirmPhoneNumber_NewAccount" of me to empty
set the label of button "button_SecurityQuestion1_NewAccount" of me to "Chose A Security Question"
set the text of field "field_SecurityQuestion1_NewAccount" of me to empty
set the label of button "button_SecurityQuestion2_NewAccount" of me to "Chose A Security Question"
set the text of field "field_SecurityQuestion2Answer_NewAccount" of me to empty
set the label of button "button_Residence_NewAccount" of me to "Chose A Security Residence"
set the text of field "field_ResidenceAnswer_NewAccount" of me to empty
set the text of field "field_City_NewAccount" of me to empty
set the text of field "field_State_NewAccount" of me to empty
set the text of field "field_ZipCode_NewAccount" of me to empty
set the text of field "field_Country_NewAccount" of me to empty
end ResetData
on PreFillInData
-- Sent right before new data is going to replace existing data in the control
end PreFillInData
setprop dgHilite pBoolean
-- This custom property is set when the highlight of your custom template has
-- changed. By default the "Background" graphic will be highlighted for you.
-- You only add script here if you want to further customize the highlight.
-- Example:
if pBoolean then
set the foregroundColor of me to the dgProp["hilited text color"] of the dgControl of me
else
set the foregroundColor of me to empty
end if
end dgHilite
getprop dgDataControl
-- Required by library so that it can locate your control.
return the long ID of me
end dgDataControl
on mouseDoubleUp pMouseBtnNum
local theKey
-- Example of how to edit the contents of a field.
-- By passing the index of the record associated with copy of this template being displayed and
-- a key (array key) the data grid will automatically save the changes the user
-- makes and refresh the UI by calling FillInData and resizeControl.
if pMouseBtnNum is 1 then
if the dgProps["allow editing"] of the dgControl of me then
switch the short name of the target
case "Label"
put "Label 1" into theKey
EditFieldText the long ID of the target, the dgIndex of me, theKey
break
end switch
end if
end if
pass mouseDoubleUp
end mouseDoubleUp