//AB/ Project oEmailText //AB/ Object oIDE_Project is a Dialog_Project //AB/ Set ProjectName to "oEmailText" //AB/ Set ProjectFileName to "EmailText.DG" //AB/ Set GenerateFileName to "NONAME2" // Project Object Structure // oEmailText is a dbModalPanel // oStart is a cRDSEdit // oEnd is a cRDSEdit // oOk_bn is a Button // oTooltip is a cTooltip // oCancel_bn is a Button // oTooltip is a cTooltip (Duplicate object name) // Register all objects Register_Object oCancel_bn Register_Object oEmailText Register_Object oEnd Register_Object oOk_bn Register_Object oStart Register_Object oTooltip //AB-IgnoreStart Use DFAllEnt.pkg Use cRDSEdit.pkg //AB-IgnoreEnd Object oEmailText Is A dbModalPanel //AB-StoreTopStart Property String psKey "Preferences" Set Locate_Mode To Popup_Locate //AB-StoreTopEnd Set Border_Style To Border_None Set Label To "Enter E-mail opening and closing phrases" Set Size To 175 273 Set Location To 7 10 Set piMinSize To 104 217 //AB-DDOStart //AB-DDOEnd Object oStart Is A cRDSEdit //AB-StoreTopStart Property String psVal "psEmailOpeningPhrase" //AB-StoreTopEnd Set Label To "Enter the E-mail opening phrase:" Set Size To 44 245 Set Location To 13 15 //AB-StoreStart Procedure DoWriteRegistryKey String sVal sSep sLine Integer iCount iItems Move (Character(13) + Character(10)) To sSep Get Line_Count To iItems For iCount From 0 To (iItems - 1) Get Value Item iCount To sLine Move (sVal + sLine) To sVal If (iItems > 1) Move (sVal + sSep) To sVal Loop Send WriteString Of ghoApplication (psKey(Self)) (psVal(Self)) sVal End_Procedure // DoWriteRegistryKey Procedure DoReadRegistryKey Handle hoReg Boolean bExist String sKey sVal sSep Move (Character(13) + Character(10)) To sSep Get RegistryKeyString Of ghoApplication To sKey Move (sKey + "\" + psKey(Self)) To sKey Get Create U_cRegistry To hoReg Get KeyExists Of hoReg sKey To bExist If bExist ; Get ReadString Of ghoApplication (psKey(Self)) (psVal(Self)) 0 To sVal If (sVal = "0") Move (False) To bExist If Not bExist Begin Move ("Thank you for recent order, here is the registration code to activate the product." + sSep + "Please start the CrossMerge Registration program (CmRegister.exe) and enter the registration details below." + sSep) To sVal Send WriteString Of ghoApplication (psKey(Self)) (psVal(Self)) sVal End // If Not bExist Begin Send Append_Text sVal Send Destroy Of hoReg End_Procedure // DoReadRegistryKey Send DoReadRegistryKey // Do on program startup. //AB-StoreEnd End_Object // oStart Object oEnd Is A cRDSEdit //AB-StoreTopStart Property String psVal "psEmailClosingPhrase" //AB-StoreTopEnd Set Label To "Enter the E-mail closing phrase:" Set Size To 68 245 Set Location To 71 15 //AB-StoreStart Procedure DoWriteRegistryKey String sVal sSep sLine Integer iCount iItems Move (Character(13) + Character(10)) To sSep Get Line_Count To iItems For iCount From 0 To (iItems - 1) Get Value Item iCount To sLine Move (sVal + sLine) To sVal If (iItems > 1) Move (sVal + sSep) To sVal Loop Send WriteString Of ghoApplication (psKey(Self)) (psVal(Self)) sVal End_Procedure // DoWriteRegistryKey Procedure DoReadRegistryKey Handle hoReg Boolean bExist String sKey sVal sCR Move (Character(13) + Character(10)) To sCR Get RegistryKeyString Of ghoApplication To sKey Move (sKey + "\" + psKey(Self)) To sKey Get Create U_cRegistry To hoReg Get KeyExists Of hoReg sKey To bExist If bExist ; Get ReadString Of ghoApplication (psKey(Self)) (psVal(Self)) 0 To sVal If (sVal = "0") Move (False) To bExist If Not bExist Begin Move ("Best Regards," + sCR + "Yves McDougall" + sCR + "Data Access Worldwide") To sVal Send WriteString Of ghoApplication (psKey(Self)) (psVal(Self)) sVal End // If Not bExist Begin Send Append_Text sVal Send Destroy Of hoReg End_Procedure // DoReadRegistryKey Send DoReadRegistryKey // Do on program startup. //AB-StoreEnd End_Object // oEnd Object oOk_bn Is A Button Set Label To "&OK" Set Location To 144 155 Set peAnchors To anBottomRight //AB-StoreStart Procedure OnClick Handle ho Move (Parent(Self)) To ho Broadcast Send DoWriteRegistryKey Of ho Send Close_Panel End_Procedure // OnClick Object oTooltip Is A cTooltip Set psTooltip To "Save opening and closing phrases to Windows registry." End_Object // oTooltip Send Activate Of (oTooltip(Self)) Procedure Page Integer iFlag Handle ho Forward Send Page iFlag Get Form_Window_Handle 0 To ho If iFlag Send AddTool To (oTooltip(Self)) ho) End_Procedure // Page Procedure DestroyToolTip Send Destroy Of oTooltip End_Procedure // DestroyToolTip //AB-StoreEnd End_Object // oOk_bn Object oCancel_bn Is A Button Set Label To "&Cancel" Set Location To 144 210 Set peAnchors To anBottomRight //AB-StoreStart Procedure OnClick Send Close_Panel End_Procedure // OnClick Object oTooltip Is A cTooltip Set psTooltip To "Closes the panel without saving changes to Windows registry." End_Object // oTooltip Send Activate Of (oTooltip(Self)) Procedure Page Integer iFlag Handle ho Forward Send Page iFlag Get Form_Window_Handle 0 To ho If iFlag Send AddTool To (oTooltip(Self)) ho) End_Procedure // Page Procedure DestroyToolTip Send Destroy Of oTooltip End_Procedure // DestroyToolTip //AB-StoreEnd End_Object // oCancel_bn //AB-StoreStart On_Key Key_Alt+Key_O Send KeyAction Of oOk_bn On_Key Key_Alt+Key_C Send KeyAction Of oCancel_bn On_Key kCancel Send KeyAction Of oCancel_bn //AB-StoreEnd End_Object // oEmailText //AB/ End_Object // oIDE_Project