Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/ffc/
Upload File :
Current File : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/ffc/_miscbtns.vct

euVERSION =   3.00!Arial, 0, 9, 5, 15, 12, 21, 3, 0
_cmdhelpPixelsgraphics\help.bmpgraphics\help.bmpGBrings up the help file, searching for the HelpContextID of the controlClass1_cmdok_commandbutton_cmdhelp �� �4%����U�����UNERRORCMETHODNLINE$I������UTHIS
HELPCONTEXTIDError,��ClickZ��1�333Om)xPROCEDURE Error
LPARAMETERS nerror,cmethod,nline

ENDPROC
PROCEDURE Click
HELP ID This.HelpContextID


ENDPROC
SHeight = 30
Width = 94
Caption = "\<Help"
HelpContextID = 0
Name = "_cmdhelp"

commandbutton	_base.vcx!Arial, 0, 9, 5, 15, 12, 21, 3, 0

_cmdrunreportPixelsClass1_commandbutton
_cmdrunreport
commandbutton_mailbtn!Arial, 0, 9, 5, 15, 12, 21, 3, 0
Pixels1!Arial, 0, 9, 5, 15, 12, 32, 3, 0
Pixelsgraphics\ok.bmpgraphics\ok.bmpClass!Arial, 0, 9, 5, 15, 12, 16, 3, 0
Pixelsgraphics\smmail.bmpgraphics\smmail.bmp'MAPI button to send the current record.Class4
_container_cmdrunformClass1_commandbutton_cmdrunform
commandbutton	_base.vcx_mailbtn_mailbtn1
_cmdcancelClassReleases form or form setgraphics\cancel.bmp[cfilename Name of form to run.
lsetcaption Automatically set caption based on cfilename.
olemSess#cfilename Name of file to launch.
!Arial, 0, 9, 5, 15, 12, 21, 3, 0

_cmdlaunchPixelsClass_commandbuttoncmdMail)Caption = "Cancel"
Name = "_cmdcancel"

_cmdlaunch
commandbuttongraphics\cancel.bmp
_cmdcancel_cmdok1!Arial, 0, 9, 5, 15, 12, 21, 3, 0

olecontrol_cmdokPixels
olecontrol
_miscbtns.vcx(Releases form or formset, default button_mailbtn_commandbuttonIHeight = 30
Width = 94
Caption = "OK"
Default = .F.
Name = "_cmdok"

commandbutton	_base.vcx	_base.vcx,OLEObject = C:\WINNT\System32\MSMAPI32.OCX
ITop = -1000
Left = -1000
Height = 100
Width = 100
Name = "olemSess"
,OLEObject = C:\WINNT\System32\MSMAPI32.OCX
ITop = -1000
Left = -1000
Height = 100
Width = 100
Name = "oleMmess"
oleMmess
olecontrol
olecontrol_mailbtn	_base.vcxUPROCEDURE Init
#DEFINE CAPTION_LOC	"\<Display"

IF THIS.lSetCaption AND UPPER(THIS.Caption)=UPPER(CAPTION_LOC) AND !EMPTY(THIS.cFileName)
	THIS.Caption = PROPER(JUSTSTEM(THIS.cFileName))
	THIS.AutoSize = .T.
	THIS.AutoSize = .F.
ENDIF

ENDPROC
PROCEDURE Click
IF FILE(THIS.cFileName)
	DO FORM (THIS.cFileName)
ENDIF

ENDPROC

commandbutton_commandbutton	container	_base.vcx	_base.vcxNCaption = "\<Display"
cfilename = 
lsetcaption = .T.
Name = "_cmdrunform"
�PROCEDURE Click
LOCAL cAPP
IF EMPTY(this.cFileName) OR !FILE(this.cFileName)
	RETURN .F.
ENDIF

IF UPPER(JUSTEXT(THIS.cFileName)) = "APP"
	DO (THIS.cFileName)
ELSE
	cApp = this.cFileName
	RUN /N &cApp
ENDIF

ENDPROC

commandbuttonyTop = 0
Left = 0
Height = 25
Width = 25
Picture = graphics\smmail.bmp
Caption = ""
TabIndex = 1
Name = "cmdMail"
dWidth = 25
Height = 25
BorderWidth = 0
TabIndex = 1
BackColor = 192,192,192
Name = "_mailbtn"
Y�� @@7�%����U����%�C����
C��0
��-�B�-���%�CC����f�APP��Z�
��������T������RUN /N &cApp
�UCAPPTHIS	CFILENAMEClick,��1q�qA���A2�)@RHeight = 32
Width = 63
Caption = "\<Launch"
cfilename = 
Name = "_cmdlaunch"
��ࡱ�>��	��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Root Entry�������� VPAs�OleObjectData����,AccessObjSiteData&������������\ChangedProps��������������������	
�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������,� ���DEST!C4��Pr�W\$8mgkgtgnnmnmninigthkgogggvmkhinjggnvm���ࡱ�>��	��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Root Entry����������NAs�OleObjectData����0AccessObjSiteData&������������\ChangedProps��������������������	

���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������,� ���DEST!C4��0W�\$8mgkgtgnnmnmninigthkgogggvmkhinjggnvm���� nn9�%oD��U��������5��%�CC&���i�9��C�*No table is open in the current work area.�0�x��B����%�C���
����B��%����	����T���
����������C��
���
T����������(�C�
���6�%�CC���
>����2�T��CC���
>����������
��
T����������(�C�
���M�T��CCC���
f���&T���C��: ������!if !isnull(&lvFieldValue)�,�
H���(�B�C���
�N�C���
�B�C���
�F��j�GlcMessageText = lcMessageText + alltrim(str(&lvFieldValue))+chr(13)
�C���
�Y����NlcMessageText = lcMessageText+"$"+alltrim(str(&lvFieldValue,10,2))+chr(13)
.�C���
�C�C���
�M��@�@lcMessageText=lcMessageText + alltrim(&lvFieldValue)+chr(13)
�C���
�G����\T����EGeneral fields are not supported in this example and will be skipped.C�
 ���C���
�D���GlcMessageText=lcMessageText + alltrim(DTOC(&lvFieldValue))+chr(13)	
�C���
�T��y�HlcMessageText = lcMessageText + alltrim(TTOC(&lvFieldValue))+chr(13)
�C���
�L����if &lvFieldValue���T����TRUEC�
 �����T����FALSEC�
 ���2�(�2T����Field could not be printed.C�
 ����I�T����NULL�����T���
�����1T���
��CC&���: �Record #CCCOZ�����C����
���%����	�������������UJLNMAXLENGTHI
LCMESSAGETEXTLVFIELDVALUEARRAYTHISPARENTSIGNON
LOGSESSIONOLEMMESS	SESSIONIDOLEMSESS
PADBFIELDSCOMPOSEADDTABSMSGNOTETEXT
MSGSUBJECTSENDSIGNOFFX�������CCE�0�x��%������@��������T����-��UNERRORCMETHODNLINETHISPARENT
LOGSESSIONOLEMSESSSIGNOFFClick,��Error���1pqs��A�QAA1������AA���a�!q������q�������A�!A�QAAaa1AAA3��1A2r=�+y)nllogsession Whether successful login to mail.
*addtabs Adds tabs to the strings.
*signon Signs onto mail.
%lsetcaption Automatically set caption based on cfilename.
cfilename Name of report to run.
luseoutputdialog Whether to displays FFC output dialog.
coutputdialogalias Name of output dialog alias.
loutputdialogpreventscope Whether to prevent user from changing scope in dialog.
loutputdialogpreventsource Whether to prevent user from changing alias/report in dialog.
lpromptforreport Whether to ask for report name.
cdialogclass Output dialog class.
cdialogclasslib Output dialog class library.
*showoutputdialog Displays FFC output dialog.

Caption = "\<Preview"
TabIndex = 1
lsetcaption = .T.
cfilename = 
luseoutputdialog = .T.
coutputdialogalias = 
lpromptforreport = .T.
cdialogclass = _outputdialog
cdialogclasslib = (IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_REPORTS.VCX")
Name = "_cmdrunreport"
��� ��o�%C-�Us8%����C��fC�	\<Displayf	�
C���
	��l�T���CC���ּ��T���a��T���-���UTHISLSETCAPTIONCAPTION	CFILENAMEAUTOSIZE'%�C��0�� �������UTHIS	CFILENAMEInit,��Click���1����A3!�A2�J)���� uu�l%�+��UF#%�C�THISFORM.PARENTb�O��-�
�����?�
�����UTHISFORMSETRELEASETHISFORM������������
H�/������1����
H�N���!�CC�	Buffering�����q������(�CC.��m�T��C�
�/��%�C�
��_C�
����i��T��C�Data in �� was changed by another user.C�
 �(Do you want to save your changes anyway?�4�
Data Conflict�x��%��
����S���C-a���e�
��C-������!�CC�	Buffering�������T��C���+��
�����������(�CC.����T��C�
�/��%�C��_C�
�������T��C�Data in �� was changed by another user.C�
 �(Do you want to save your changes anyway?�4�
Data Conflict�x��%��
��������C-a�����
��C-������T��C�
������UNERRORCMETHODNLINENFIELDCFIELDNCHOICENRECClick,��Error���11���A3�8�!���"1���AAAA��"1���AAA!AAA2i��	)u�PROCEDURE addtabs
parameters tcString, tnMaxLength
#DEFINE TABSPACES	8 	&& Number of characters that will equal 1 TAB
local i, lnAdd, lnMaxTabs
lnMaxTabs=int(tnMaxLength/TABSPACES)+1
lnAdd = lnMaxTabs - INT(len(tcString)/TABSPACES)
for i = 1 to lnAdd
	tcString = tcString + chr(9)
endfor
return tcString
ENDPROC
PROCEDURE signon
#DEFINE ERR_NOMAPI_LOC	"It does not appear that you have MAPI installed. Mail could not be run."

this.logsession = .T.

IF !FILE(GETENV("WINDIR")+"\SYSTEM32\MAPI32.DLL");
	AND !FILE(GETENV("WINDIR")+"\SYSTEM\MAPI32.DLL")
	MESSAGEBOX(ERR_NOMAPI_LOC)
	RETURN .F.
ENDIF

this.OLEMSess.signon

ENDPROC
PROCEDURE Init
this.logsession = .F.
ENDPROC
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine
LOCAL aErrs
DIMENSION aErrs[1]
AERROR(aErrs)
IF BETWEEN(aErrs[1,1],1420,1450)
	MESSAGEBOX(aErrs[1,3],48)
ELSE
	MESSAGEBOX(message(),48)
ENDIF
this.logsession = .F.
ENDPROC
6PROCEDURE Click
*:*********************************************************************
*:
*: 	   Class file: \samples\ole\mapibtn.vcx
*:
*:         System: OLE
*:         Author: Microsoft Corporation
*:		  Created: 01/04/95
*:	Last modified: 04/13/95
*:
*:
*:*********************************************************************
* This is sample class which demonstrates how to use the MAPI controls. 
*
* It starts a new Mail session, collects data from the current record, 
* and brings up the Send Mail dialog with the data inserted as the 
* message text.
*
* To use this example, add this class to a form. You will need to open a
* table before pressing the Send Mail button. This will work with any 
* Visual FoxPro table. 
*
* This class includes a custom method addtabs for formatting the 
* information gathered from the table and inserted in the mail message.
*
* This class also takes advantage of another custom method called "signon" 
* as well as a custom property called logsession. This method and property
* are necessary for proper error handling of the MAPI server (i.e. MSMail,
* Exchange, etc.)
*
* This class also uses the smmail.bmp and next.bmp as the icons of the button
* controls.
*
* In order for this button to function properly MSMAPI32.OCX must be 
* correctly registered in the registration database and a mail 
* application supported by the MAPI controls must be installed. The 
* MAPI controls do not work with Windows for Workgroups or Windows 3.1.
*
***********************************************************************

local j, lnMaxLength, i, lcMessageText, lvFieldValue
** j & i are counters

private array paDBFields

*** Localizable Strings
#DEFINE DBF_NOT_FOUND_LOC	"No table is open in the current work area."
#DEFINE GEN_UNSUPPORT_LOC	"General fields are not supported in this example and will be skipped."
#DEFINE _FALSE_LOC			"FALSE"
#DEFINE _TRUE_LOC			"TRUE"
#DEFINE _NULL_LOC			"NULL"
#DEFINE _DOLLARSIGN_LOC		"$"
#DEFINE FLD_NO_PRINT_LOC	"Field could not be printed."
#DEFINE RECORDNUM_LOC		"Record #"

* Verify that a table is open in the current work area
if empty(dbf())
	=messagebox(DBF_NOT_FOUND_LOC,48)
	return
else
	IF !this.parent.signon()			&& Use the custom method
		RETURN
	ENDIF
	IF this.parent.LogSession	&& Check if the user was able to login
		this.parent.OleMMess.sessionid=this.parent.OleMSess.sessionid
	
		* Get the number of fields in the current table
		=afields(paDBFields)

		**** find the longest field string for approximate formatting purposes
		lnMaxLength = 0
		for j = 1 to alen(paDBFields,1)
			if len(paDBFields(j,1))+2 > lnMaxLength
				lnMaxLength = len(paDBFields(j,1))+2
			endif
		endfor
	
		* Start a new mail message and build the text
		this.parent.OleMMess.compose
		lcMessageText=""
		for i = 1 to alen(paDBFields,1)
			lvFieldValue=alltrim(upper(paDBFields(i,1)))
			lcMessageText=lcMessageText+this.parent.addtabs((lvFieldValue+": "),lnMaxLength)
			if !isnull(&lvFieldValue)
				do case
					case paDBFields(i,2)= "N" or paDBFields(i,2)= "B" or paDBFields(i,2)= "F"
						lcMessageText = lcMessageText + alltrim(str(&lvFieldValue))+chr(13)
					case paDBFields(i,2) = "Y"
						lcMessageText = lcMessageText+_DOLLARSIGN_LOC+alltrim(str(&lvFieldValue,10,2))+chr(13)
					case paDBFields(i,2)= "C" or paDBFields(i,2) = "M"
						lcMessageText=lcMessageText + alltrim(&lvFieldValue)+chr(13)
					case paDBFields(i,2)= "G"
						lcMessageText=lcMessageText+GEN_UNSUPPORT_LOC+chr(13)
					case paDBFields(i,2) = "D"
						lcMessageText=lcMessageText + alltrim(DTOC(&lvFieldValue))+chr(13)	
					case paDBFields(i,2) = "T"
						lcMessageText = lcMessageText + alltrim(TTOC(&lvFieldValue))+chr(13)
					case paDBFields(i,2) = "L"
						if &lvFieldValue
							lcMessageText = lcMessageText+_TRUE_LOC+chr(13)
						else
							lcMessageText = lcMessageText+_FALSE_LOC+chr(13)
						endif
					otherwise
						lcMessageText = lcMessageText+FLD_NO_PRINT_LOC+chr(13)				
				endcase
			else
				lcMessageText=lcMessageText+_NULL_LOC
			endif
		endfor
		this.parent.OleMMess.msgnotetext=lcMessageText
		this.parent.OleMMess.msgsubject=justfname(dbf())+": "+RECORDNUM_LOC+alltrim(str(recno()))
		this.parent.OleMMess.send(1)
		IF this.parent.logsession
			this.parent.OleMSess.signoff
		ENDIF	&& Session Handle test
	ENDIF 		&& Login Test
endif			&& DBF Test
	
ENDPROC
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine
=messageb(message(),48)
IF this.parent.logsession 
	this.parent.OLEMSess.signoff
ENDIF
this.parent.logsession = .F.

ENDPROC
�� ffq%�� ��U����T��C�������%�C����O��9�B��
�������T������T������T����	��T�
�����T���
��C�����������C�����ULOFORMTHISCDIALOGCLASSCDIALOGCLASSLIBCREPORT	CFILENAMECALIASCOUTPUTDIALOGALIASLPREVENTSCOPECHANGESLOUTPUTDIALOGPREVENTSCOPELPREVENTSOURCECHANGESLOUTPUTDIALOGPREVENTSOURCE	CUSOUTPUTCBODESTINATIONSVALUE
ADESTINATIONSSHOWs8%����C��fC�	\<Previewf	�
C���
	��l�T���CC���ּ��T���a��T���-���UTHISLSETCAPTIONCAPTION	CFILENAMEAUTOSIZE�%����	C���	��Q�5T���C�FRX����Select Report to Run����%�����r�
��C�������%�C��0����?��������UTHISLPROMPTFORREPORT	CFILENAMELUSEOUTPUTDIALOGSHOWOUTPUTDIALOGshowoutputdialog,��Init���Click���1q�RAA��A3����A3�QA��!�AA2�����)fPROCEDURE showoutputdialog
LOCAL loForm
loForm = NewObject(THIS.cDialogClass,THIS.cDialogClassLib)

IF VARTYPE(loForm) # "O"
	RETURN
ENDIF

WITH loForm
	.cReport=THIS.cFileName
	.cAlias=THIS.cOutputDialogAlias
	.lPreventScopeChanges=THIS.lOutputDialogPreventScope
	.lPreventSourceChanges=THIS.lOutputDialogPreventSource
	.cusOutput.cboDestinations.Value = .cusOutput.aDestinations[2,2]
ENDWITH

loForm.Show(1)

ENDPROC
PROCEDURE Init
#DEFINE CAPTION_LOC	"\<Preview"

IF THIS.lSetCaption AND UPPER(THIS.Caption) = UPPER(CAPTION_LOC) AND !EMPTY(THIS.cFileName)
	THIS.Caption = PROPER(JUSTSTEM(THIS.cFileName))
	THIS.AutoSize = .T.
	THIS.AutoSize = .F.
ENDIF

ENDPROC
PROCEDURE Click
#DEFINE C_SELECTFRX_LOC		"Select Report to Run"

IF THIS.lPromptForReport AND EMPTY(THIS.cFileName)
	THIS.cFileName = GETFILE("FRX",'','',0,C_SELECTFRX_LOC)
ENDIF

IF THIS.lUseOutputDialog
	THIS.ShowOutputDialog()
ELSE
	IF FILE(THIS.cFileName)
		REPORT FORM (THIS.cFileName) PREVIEW
	ENDIF
ENDIF

ENDPROC
�� ���'%�B�U�4��������T��C��8���T���CC�>�8�������(����t�T���C�	 ����	B����UTCSTRINGTNMAXLENGTHILNADD	LNMAXTABS�T���a��X%�CC�WINDIR5�\SYSTEM32\MAPI32.DLL0
�%CC�WINDIR5�\SYSTEM\MAPI32.DLL0
	����S��C�GIt does not appear that you have MAPI installed. Mail could not be run.�x��B�-���
�����UTHIS
LOGSESSIONOLEMSESSSIGNONT���-��UTHIS
LOGSESSION���������
�������C���z��%�CC����������e���CC����0�x���{���CCE�0�x���T���-��UNERRORCMETHODNLINEAERRSTHIS
LOGSESSIONaddtabs,��signon���Init���Error��1��q�q1A�2��1qA�3�2�q���a��A�18
U�����)��PROCEDURE Click
IF TYPE("THISFORM.PARENT") = 'O'
	THISFORMSET.Release
ELSE
	THISFORM.Release
ENDIF

ENDPROC
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine

#DEFINE MSG_DATAIN_LOC		"Data in "
#DEFINE MSG_CHANGED_LOC		" was changed by another user."
#DEFINE MSG_SAVE_LOC		"Do you want to save your changes anyway?"
#DEFINE MSG_CONFLICT_LOC	"Data Conflict"
#DEFINE CR_LOC 				CHR(13)

LOCAL nField,cField,nChoice,nRec

DO CASE
	CASE nError = 1585 && Update conflict
	  DO CASE
	    CASE INLIST(CURSORGETPROP('Buffering'), 2,3) && Row Buffering
			FOR nField = 1 to FCOUNT(ALIAS())
			cField = FIELD(m.nField)
			  IF OLDVAL(m.cField) != CURVAL(m.cField)
				nChoice = MESSAGEBOX(MSG_DATAIN_LOC + cField + MSG_CHANGED_LOC + ;
					CR_LOC + MSG_SAVE_LOC, 4+48, MSG_CONFLICT_LOC)
				IF m.nChoice = 6 && yes
					=TABLEUPDATE(.F., .T.)
				ELSE
					=TABLEREVERT(.F.)
				ENDIF
			  ENDIF
			ENDFOR
		CASE INLIST(CURSORGETPROP('Buffering'), 4,5)
		nRec = GETNEXTMODIFIED(0)
		DO WHILE m.nRec > 0
			FOR nField = 1 to FCOUNT(ALIAS())
				cField = FIELD(m.nField)
				IF OLDVAL(cField) != CURVAL(m.cField)
					nChoice = MESSAGEBOX(MSG_DATAIN_LOC + cField + MSG_CHANGED_LOC + ;
					CR_LOC + MSG_SAVE_LOC, 4+48, MSG_CONFLICT_LOC)
					IF m.nChoice = 6 && yes
						=TABLEUPDATE(.F., .T.)
					ELSE
						=TABLEREVERT(.F.)
					ENDIF
				ENDIF
			ENDFOR
			nRec = GETNEXTMODIFIED(m.nRec)	
		ENDDO
		ENDCASE
ENDCASE		

ENDPROC