*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.21" SourceFile="pr_sendmail.scx" CPID="1252" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS dataenvironment AS dataenvironment 
 	*< CLASSDATA: Baseclass="dataenvironment" Timestamp="" Scale="" Uniqueid="" ClassIcon="2" />

	*<PropValue>
		DataSource = .NULL.
		Height = 0
		Left = 0
		Name = "Dataenvironment"
		Top = 0
		Width = 0
	*</PropValue>

ENDDEFINE

DEFINE CLASS frmsendmail AS form 
 	*< CLASSDATA: Baseclass="form" Timestamp="" Scale="" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="cmdSend" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="cmdCancel" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblTo" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtDestination" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblSubject" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="txtSubject" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblBody" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="edtBody" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblAttachment" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Image1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: updatecontrol
		*m: updatetable
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		AllowOutput = .F.
		AlwaysOnTop = .T.
		AutoCenter = .T.
		BorderStyle = 2
		Caption = "Send Email"
		Closable = .F.
		DataSession = 2
		Desktop = .T.
		DoCreate = .T.
		Height = 400
		Icon = ..\..\..\..\
		MaxButton = .F.
		MinButton = .F.
		Name = "frmSendMail"
		ShowWindow = 1
		Width = 470
		WindowType = 1
		_memberdata = <VFPData>
			<memberdata name="updatecontrol" display="UpdateControl"/>
			<memberdata name="updatetable" display="UpdateTable"/>
		</VFPData>
	*</PropValue>

	ADD OBJECT 'cmdCancel' AS commandbutton WITH ;
		Cancel = .T., ;
		Caption = "Cancel", ;
		Height = 27, ;
		Left = 372, ;
		Name = "cmdCancel", ;
		TabIndex = 6, ;
		Top = 360, ;
		Width = 84
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'cmdSend' AS commandbutton WITH ;
		Caption = "Send", ;
		Height = 27, ;
		Left = 276, ;
		Name = "cmdSend", ;
		TabIndex = 5, ;
		Top = 360, ;
		Width = 84
		*< END OBJECT: BaseClass="commandbutton" />

	ADD OBJECT 'edtBody' AS editbox WITH ;
		Height = 240, ;
		Left = 87, ;
		Name = "edtBody", ;
		TabIndex = 4, ;
		Top = 110, ;
		Width = 370
		*< END OBJECT: BaseClass="editbox" />

	ADD OBJECT 'Image1' AS image WITH ;
		BackStyle = 0, ;
		Height = 16, ;
		Left = 62, ;
		Name = "Image1", ;
		Picture = images\pr_attach.bmp, ;
		Top = 84, ;
		Width = 16
		*< END OBJECT: BaseClass="image" />

	ADD OBJECT 'lblAttachment' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Attachment", ;
		Height = 17, ;
		Left = 85, ;
		Name = "lblAttachment", ;
		TabIndex = 3, ;
		Top = 84, ;
		Width = 63
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lblBody' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Body:", ;
		Height = 17, ;
		Left = 14, ;
		Name = "lblBody", ;
		TabIndex = 9, ;
		Top = 110, ;
		Width = 32
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lblSubject' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Subject:", ;
		Height = 17, ;
		Left = 14, ;
		Name = "lblSubject", ;
		TabIndex = 8, ;
		Top = 52, ;
		Width = 46
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'lblTo' AS label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "To:", ;
		Height = 17, ;
		Left = 14, ;
		Name = "lblTo", ;
		TabIndex = 7, ;
		Top = 16, ;
		Width = 19
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'txtDestination' AS textbox WITH ;
		Height = 23, ;
		Left = 87, ;
		Name = "txtDestination", ;
		TabIndex = 1, ;
		Top = 16, ;
		Width = 370
		*< END OBJECT: BaseClass="textbox" />

	ADD OBJECT 'txtSubject' AS textbox WITH ;
		Height = 23, ;
		Left = 87, ;
		Name = "txtSubject", ;
		TabIndex = 2, ;
		Top = 52, ;
		Width = 370
		*< END OBJECT: BaseClass="textbox" />
	
	PROCEDURE Init
		LPARAMETERS tcFile
		Thisform.lblAttachment.Caption = JUSTFNAME(tcFile)
		Thisform.AddProperty("lCancelled", .F.)
		
		TRY
			This.Icon = _goFP.cFormIcon
		CATCH
		ENDTRY
		
		TRY
			WITH _goFP
				This.txtDestination.Value = .cEmailTo
				This.txtSubject.Value     = .cEmailSubject
				This.edtBody.Value        =	.cEmailBody
			
				This.Caption            = .GetLoc("SENDEMAIL")
				This.CmdCancel.Caption  = .GetLoc("CANCEL")
				This.CmdSend.Caption    = .GetLoc("SEND")
				This.lblBody.Caption    = .GetLoc("BODY")
				This.lblSubject.Caption = .GetLoc("SUBJECT")
				This.lblTo.Caption      = .GetLoc("TO")
			ENDWITH
		CATCH
		ENDTRY
	ENDPROC

	PROCEDURE Load
		SET TALK OFF
		SET CONSOLE OFF 
	ENDPROC

	PROCEDURE Unload
		RETURN Thisform.lCancelled
	ENDPROC

	PROCEDURE updatecontrol
	ENDPROC

	PROCEDURE updatetable
	ENDPROC

	PROCEDURE cmdCancel.Click
		Thisform.lCancelled = .T.
		Thisform.Release()
	ENDPROC

	PROCEDURE cmdSend.Click
		WITH _goFP
			.cEmailTo      = ALLTRIM(Thisform.txtDestination.Value)
			.cEmailSubject = ALLTRIM(Thisform.txtSubject.Value)
			.cEmailBody    = Thisform.edtBody.Value
		ENDWITH 
		
		Thisform.Release()
	ENDPROC

ENDDEFINE
