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

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />

	*<PropValue>
		Height = 34
		Name = "bluetabh"
		Picture = dbtabh4.bmp
		Width = 84
		cmdTab.Height = 31
		cmdTab.Left = 0
		cmdTab.Name = "cmdTab"
		cmdTab.Top = 0
		cmdTab.Width = 49
		cmdTab.ZOrderSet = 0
		Image1.Height = 34
		Image1.Left = 0
		Image1.Name = "Image1"
		Image1.Picture = ..\grafice\dbtabh3.bmp
		Image1.Stretch = 2
		Image1.Top = 0
		Image1.Width = 84
		Image1.ZOrderSet = 1
		Image2.Height = 16
		Image2.Left = 15
		Image2.Name = "Image2"
		Image2.Picture = ..\grafice\note.gif
		Image2.Stretch = 2
		Image2.Top = 6
		Image2.Width = 16
		Image2.ZOrderSet = 2
	*</PropValue>

	ADD OBJECT 'Label1' AS _label WITH ;
		Alignment = 0, ;
		BackStyle = 0, ;
		Caption = "Visits", ;
		FontSize = 8, ;
		ForeColor = 255,255,255, ;
		Height = 16, ;
		Left = 7, ;
		Name = "Label1", ;
		Top = 21, ;
		Width = 29
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />
	
	PROCEDURE Init
		* override base code
		WITH This.cmdTab
			.ZOrder(0)
			.ToolTipText = This.ToolTipText 
			.Width = This.Image1.Width - 15
		ENDWITH
		
	ENDPROC

ENDDEFINE

DEFINE CLASS bottomactioncontainer AS _container OF "..\..\comun\clase\_baza.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Tabhyperlink1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Tabhyperlink2" UniqueID="" Timestamp="" />

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

	*<PropValue>
		BackStyle = 0
		BorderWidth = 0
		Height = 90
		Name = "bottomactioncontainer"
		Width = 304
		_memberdata = <VFPData>

		</VFPData>
	*</PropValue>

	ADD OBJECT 'Shape3' AS _shape WITH ;
		Anchor = 14, ;
		BackColor = 181,198,255, ;
		BorderColor = 99,148,234, ;
		Curvature = 15, ;
		Height = 36, ;
		Left = 0, ;
		Name = "Shape3", ;
		Top = 54, ;
		Width = 246
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'Tabhyperlink1' AS tabhyperlink WITH ;
		Height = 18, ;
		Left = 10, ;
		Name = "Tabhyperlink1", ;
		Top = 12, ;
		Width = 161, ;
		Image2.Height = 12, ;
		Image2.Name = "Image2", ;
		Image2.Width = 15, ;
		Label1.Alignment = 0, ;
		Label1.Name = "Label1"
		*< END OBJECT: ClassLib="bbtabs.vcx" BaseClass="container" />

	ADD OBJECT 'Tabhyperlink2' AS tabhyperlink WITH ;
		Height = 18, ;
		Left = 10, ;
		Name = "Tabhyperlink2", ;
		Top = 36, ;
		Width = 161, ;
		Image2.Height = 12, ;
		Image2.Name = "Image2", ;
		Image2.Width = 15, ;
		Label1.Alignment = 0, ;
		Label1.Name = "Label1"
		*< END OBJECT: ClassLib="bbtabs.vcx" BaseClass="container" />

ENDDEFINE

DEFINE CLASS bottomactioncontainerh AS bottomactioncontainer OF "bbtabs.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Line1" UniqueID="" Timestamp="" />

	*<PropValue>
		Height = 35
		Name = "bottomactioncontainerh"
		Width = 639
		_memberdata = <VFPData>

		</VFPData>
		Shape3.Height = 39
		Shape3.Left = 0
		Shape3.Name = "Shape3"
		Shape3.Top = -5
		Shape3.Width = 541
		Shape3.ZOrderSet = 0
		Tabhyperlink1.Anchor = 132
		Tabhyperlink1.Height = 18
		Tabhyperlink1.Image2.Height = 12
		Tabhyperlink1.Image2.Name = "Image2"
		Tabhyperlink1.Image2.Width = 15
		Tabhyperlink1.Label1.Alignment = 0
		Tabhyperlink1.Label1.Name = "Label1"
		Tabhyperlink1.Left = 10
		Tabhyperlink1.Name = "Tabhyperlink1"
		Tabhyperlink1.Top = 12
		Tabhyperlink1.Width = 169
		Tabhyperlink1.ZOrderSet = 3
		Tabhyperlink2.Anchor = 132
		Tabhyperlink2.Height = 18
		Tabhyperlink2.Image2.Height = 12
		Tabhyperlink2.Image2.Name = "Image2"
		Tabhyperlink2.Image2.Width = 15
		Tabhyperlink2.Label1.Alignment = 0
		Tabhyperlink2.Label1.Name = "Label1"
		Tabhyperlink2.Left = 187
		Tabhyperlink2.Name = "Tabhyperlink2"
		Tabhyperlink2.Top = 12
		Tabhyperlink2.Width = 169
		Tabhyperlink2.ZOrderSet = 4
	*</PropValue>

	ADD OBJECT 'Line1' AS line WITH ;
		BorderColor = 99,148,234, ;
		Height = 0, ;
		Left = 0, ;
		Name = "Line1", ;
		Top = 0, ;
		Width = 541
		*< END OBJECT: BaseClass="line" />
	
	PROCEDURE Init
		This.Shape3.Width = THis.Width - 1
		This.Shape3.Height  = THis.Height - 4
		
	ENDPROC

ENDDEFINE

DEFINE CLASS buletabs AS _container OF "_baza.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="cmdTab" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Image1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Image2" UniqueID="" Timestamp="" />

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

	*<PropValue>
		BackStyle = 0
		BorderWidth = 0
		Height = 57
		Name = "buletabs"
		Picture = ..\
		Width = 41
		_memberdata = <VFPData>
			<memberdata name="tabclicked" type="method" display="tabclicked" favorites="True"/>
		</VFPData>
	*</PropValue>

	ADD OBJECT 'cmdTab' AS _commandbutton WITH ;
		Caption = "", ;
		Height = 48, ;
		Left = 0, ;
		Name = "cmdTab", ;
		Style = 1, ;
		Top = 2, ;
		Width = 32
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="commandbutton" />

	ADD OBJECT 'Image1' AS _image WITH ;
		BackStyle = 0, ;
		Height = 54, ;
		Left = 1, ;
		Name = "Image1", ;
		Picture = ..\grafice\bluetab.bmp, ;
		Top = 1, ;
		Width = 31
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="image" />

	ADD OBJECT 'Image2' AS _image WITH ;
		BackStyle = 0, ;
		Height = 18, ;
		Left = 8, ;
		Name = "Image2", ;
		Picture = ..\grafice\note.gif, ;
		Top = 10, ;
		Width = 20
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="image" />
	
	PROCEDURE Init
		This.cmdTab.ZOrder(0)
	ENDPROC

	PROCEDURE MouseEnter
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		*This.Parent.EnterMouse(This)
	ENDPROC

	PROCEDURE MouseLeave
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		*This.Parent.LeaveMouse(This)
	ENDPROC

	PROCEDURE tabclicked
		* tab button was clicked
		This.Parent.tabclicked(This)
	ENDPROC

	PROCEDURE cmdTab.Click
		This.Parent.tabclicked()
	ENDPROC

	PROCEDURE cmdTab.MouseEnter
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		*This.Parent.MouseEnter(nButton, nShift, nXCoord, nYCoord)
	ENDPROC

	PROCEDURE cmdTab.MouseLeave
		LPARAMETERS nButton, nShift, nXCoord, nYCoord
		*This.Parent.MouseLeave(nButton, nShift, nXCoord, nYCoord)
	ENDPROC

ENDDEFINE

DEFINE CLASS clienttoptabs AS _container OF "_baza.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Shape1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Shape3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="lblHeader" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="_container1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Line1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Tab1" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="shpPage" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="shpPage.Label2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="shpPage.Label3" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="shpPage.Label4" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*m: changehyperlinks		&& changes the links at bottom
		*m: entermouse		&& called by mouse entering a tab
		*m: leavemouse		&& called by mouse leaving a tab
		*m: setupactions		&& Sets up the action links below. Requires a table called Actions.dbf
		*m: setuparrays		&& sets up the array with the labels and bmps
		*m: setuptabs		&& Sets up the tabs based on properties
		*m: showhelp		&& sets up help
		*m: tabclicked		&& Run when a tab is clicked. Usually sets the current tab.
		*m: zreadme		&& Readme for this class usage
		*p: activetab		&& the number of the active tab
		*p: lasttabbmp		&& name of the last tab bmp visited.
		*p: otab2use		&& The full path to the tab object to use for this control. eg. ThisForm.pagMyTabs
		*p: tabbmpstr		&& comma separated string  of bmps to show for the tabs
		*p: tabcaptionstr		&& comma delimited string that contains the captions to use. Note: if 5 captions entered then there will be 5 tabs. Minimum is 1 caption = 1 tab.. Restrict the length of each caption so that they fit.
		*p: tabnumber		&& Number of tabs to use. Used Internally
		*a: tabbmps[1,1]		&& Used internally to hold bmp names of tabs
		*a: tabcaptions[1,1]		&& used internally to store tab settings of caption
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		activetab = 1
		BackStyle = 0
		BorderWidth = 0
		Height = 430
		lasttabbmp =  
		Name = "clienttoptabs"
		otab2use = 
		tabbmpstr = homeside.bmp,contacts.bmp,visits.bmp,phone1.bmp
		tabcaptionstr = Tab1,tab2,tab3,tab4
		tabnumber = 4
		Width = 414
		_memberdata = <VFPData>
			<memberdata name="changehyperlinks" type="method" display="ChangeHyperLinks" favorites="True"/>
			<memberdata name="actionicon1" type="property" display="ActionIcon1" favorites="True" script="LOCAL aControl[1],cFile,cFileOld&#xA;IF ASELOBJ(aControl) = 0&#xA;	IF ASELOBJ(aControl,1) = 0&#xA;		RETURN&#xA;	ENDIF&#xA;ENDIF&#xA;* grab defa value&#xA;IF VARTYPE(aControl[1].ActionIcon1) = &quot;C&quot;&#xA;	cFileOld = aControl[1].ActionIcon1&#xA;ELSE&#xA;	cFileOld = &quot;&quot;&#xA;ENDIF&#xA;cFile = JUSTFNAME(GETFILE(&quot;BMP&quot;,&quot;Select a BMP&quot;,&quot;Open&quot;))&#xA;IF EMPTY(cFile)&#xA;	cFile = cFileOld&#xA;ENDIF&#xA;aControl[1].ActionIcon1 = cFile&#xA;RETURN"/>
			<memberdata name="actionicon2" type="property" display="ActionIcon2" favorites="True" script="LOCAL aControl[1],cFile,cFileOld&#xA;IF ASELOBJ(aControl) = 0&#xA;	IF ASELOBJ(aControl,1) = 0&#xA;		RETURN&#xA;	ENDIF&#xA;ENDIF&#xA;* grab defa value&#xA;IF VARTYPE(aControl[1].ActionIcon2) = &quot;C&quot;&#xA;	cFileOld = aControl[1].ActionIcon2&#xA;ELSE&#xA;	cFileOld = &quot;&quot;&#xA;ENDIF&#xA;cFile = JUSTFNAME(GETFILE(&quot;BMP&quot;,&quot;Select a BMP&quot;,&quot;Open&quot;))&#xA;IF EMPTY(cFile)&#xA;	cFile = cFileOld&#xA;ENDIF&#xA;aControl[1].ActionIcon2 = cFile&#xA;RETURN"/>
			<memberdata name="actionicon3" type="property" display="ActionIcon3" favorites="True" script="LOCAL aControl[1],cFile,cFileOld&#xA;IF ASELOBJ(aControl) = 0&#xA;	IF ASELOBJ(aControl,1) = 0&#xA;		RETURN&#xA;	ENDIF&#xA;ENDIF&#xA;* grab defa value&#xA;IF VARTYPE(aControl[1].ActionIcon3) = &quot;C&quot;&#xA;	cFileOld = aControl[1].ActionIcon3&#xA;ELSE&#xA;	cFileOld = &quot;&quot;&#xA;ENDIF&#xA;cFile = JUSTFNAME(GETFILE(&quot;BMP&quot;,&quot;Select a BMP&quot;,&quot;Open&quot;))&#xA;IF EMPTY(cFile)&#xA;	cFile = cFileOld&#xA;ENDIF&#xA;aControl[1].ActionIcon3 = cFile&#xA;RETURN"/>
			<memberdata name="actionaction1" type="property" display="ActionAction1" favorites="True"/>
			<memberdata name="actionaction2" type="property" display="ActionAction2" favorites="True"/>
			<memberdata name="actionaction3" type="property" display="ActionAction3" favorites="True"/>
			<memberdata name="actionaction4" type="property" display="ActionAction4" favorites="True"/>
			<memberdata name="actioncaption1" type="property" display="ActionCaption1" favorites="True"/>
			<memberdata name="actioncaption2" type="property" display="ActionCaption2" favorites="True"/>
			<memberdata name="actioncaption3" type="property" display="ActionCaption3" favorites="True"/>
			<memberdata name="tabicon1" type="property" display="TabIcon1" favorites="True" script="LOCAL aControl[1],cFile,cFileOld&#xA;IF ASELOBJ(aControl) = 0&#xA;	IF ASELOBJ(aControl,1) = 0&#xA;		RETURN&#xA;	ENDIF&#xA;ENDIF&#xA;* grab defa value&#xA;IF VARTYPE(aControl[1].TabIcon1) = &quot;C&quot;&#xA;	cFileOld = aControl[1].TabIcon1&#xA;ELSE&#xA;	cFileOld = &quot;&quot;&#xA;ENDIF&#xA;cFile = JUSTFNAME(GETFILE(&quot;BMP&quot;,&quot;Select a BMP&quot;,&quot;Open&quot;))&#xA;IF EMPTY(cFile)&#xA;	cFile = cFileOld&#xA;ENDIF&#xA;aControl[1].TabIcon1 = cFile&#xA;RETURN" Flux="Heavy"/>
			<memberdata name="tabicon2" type="property" display="TabIcon2" favorites="True" script="LOCAL aControl[1],cFile,cFileOld&#xA;IF ASELOBJ(aControl) = 0&#xA;	IF ASELOBJ(aControl,1) = 0&#xA;		RETURN&#xA;	ENDIF&#xA;ENDIF&#xA;* grab defa value&#xA;IF VARTYPE(aControl[1].TabIcon2) = &quot;C&quot;&#xA;	cFileOld = aControl[1].TabIcon2&#xA;ELSE&#xA;	cFileOld = &quot;&quot;&#xA;ENDIF&#xA;cFile = JUSTFNAME(GETFILE(&quot;BMP&quot;,&quot;Select a BMP&quot;,&quot;Open&quot;))&#xA;IF EMPTY(cFile)&#xA;	cFile = cFileOld&#xA;ENDIF&#xA;aControl[1].TabIcon2 = cFile&#xA;RETURN"/>
			<memberdata name="tabicon3" type="property" display="TabIcon3" favorites="True" script="LOCAL aControl[1],cFile,cFileOld&#xA;IF ASELOBJ(aControl) = 0&#xA;	IF ASELOBJ(aControl,1) = 0&#xA;		RETURN&#xA;	ENDIF&#xA;ENDIF&#xA;* grab defa value&#xA;IF VARTYPE(aControl[1].TabIcon3) = &quot;C&quot;&#xA;	cFileOld = aControl[1].TabIcon3&#xA;ELSE&#xA;	cFileOld = &quot;&quot;&#xA;ENDIF&#xA;cFile = JUSTFNAME(GETFILE(&quot;BMP&quot;,&quot;Select a BMP&quot;,&quot;Open&quot;))&#xA;IF EMPTY(cFile)&#xA;	cFile = cFileOld&#xA;ENDIF&#xA;aControl[1].TabIcon3 = cFile&#xA;RETURN"/>
			<memberdata name="tabicon4" type="property" display="TabIcon4" favorites="True" script="LOCAL aControl[1],cFile,cFileOld&#xA;IF ASELOBJ(aControl) = 0&#xA;	IF ASELOBJ(aControl,1) = 0&#xA;		RETURN&#xA;	ENDIF&#xA;ENDIF&#xA;* grab defa value&#xA;IF VARTYPE(aControl[1].TabIcon4) = &quot;C&quot;&#xA;	cFileOld = aControl[1].TabIcon4&#xA;ELSE&#xA;	cFileOld = &quot;&quot;&#xA;ENDIF&#xA;cFile = JUSTFNAME(GETFILE(&quot;BMP&quot;,&quot;Select a BMP&quot;,&quot;Open&quot;))&#xA;IF EMPTY(cFile)&#xA;	cFile = cFileOld&#xA;ENDIF&#xA;aControl[1].TabIcon4 = cFile&#xA;RETURN"/>
			<memberdata name="tabicon5" type="property" display="TabIcon5" favorites="True" script="LOCAL aControl[1],cFile,cFileOld&#xA;IF ASELOBJ(aControl) = 0&#xA;	IF ASELOBJ(aControl,1) = 0&#xA;		RETURN&#xA;	ENDIF&#xA;ENDIF&#xA;* grab defa value&#xA;IF VARTYPE(aControl[1].TabIcon5) = &quot;C&quot;&#xA;	cFileOld = aControl[1].TabIcon5&#xA;ELSE&#xA;	cFileOld = &quot;&quot;&#xA;ENDIF&#xA;cFile = JUSTFNAME(GETFILE(&quot;BMP&quot;,&quot;Select a BMP&quot;,&quot;Open&quot;))&#xA;IF EMPTY(cFile)&#xA;	cFile = cFileOld&#xA;ENDIF&#xA;aControl[1].TabIcon5 = cFile&#xA;RETURN"/>
			<memberdata name="tabcaption1" type="property" display="TabCaption1" favorites="True"/>
			<memberdata name="tabcaption2" type="property" display="TabCaption2" favorites="True"/>
			<memberdata name="tabcaption3" type="property" display="TabCaption3" favorites="True"/>
			<memberdata name="tabcaption4" type="property" display="TabCaption4" favorites="True"/>
			<memberdata name="tabcaption5" type="property" display="TabCaption5" favorites="True"/>
			<memberdata name="setupactions" type="method" display="SetupActions"/>
			<memberdata name="otab2use" type="property" display="oTab2use" favorites="True"/>
		</VFPData>
	*</PropValue>

	ADD OBJECT '_container1' AS _container WITH ;
		Height = 35, ;
		Left = 6, ;
		Name = "_container1", ;
		Top = 385, ;
		Width = 402, ;
		Shape3.Name = "Shape3", ;
		Shape3.Width = 401, ;
		Line1.Name = "Line1"
		*< END OBJECT: ClassLib="opersonal.vcx" BaseClass="container" />

	ADD OBJECT 'lblHeader' AS _label WITH ;
		AutoSize = .T., ;
		BackStyle = 0, ;
		Caption = "Memberships", ;
		FontBold = .T., ;
		FontSize = 14, ;
		ForeColor = 255,134,11, ;
		Height = 25, ;
		Left = 12, ;
		Name = "lblHeader", ;
		TabIndex = 7, ;
		Top = 41, ;
		Width = 129, ;
		ZOrderSet = 4
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="label" />

	ADD OBJECT 'Line1' AS _linie WITH ;
		Anchor = 11, ;
		BorderColor = 0,51,153, ;
		Height = 0, ;
		Left = 109, ;
		Name = "Line1", ;
		Top = 67, ;
		Width = 305, ;
		ZOrderSet = 6
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="line" />

	ADD OBJECT 'Shape1' AS _shape WITH ;
		Anchor = 15, ;
		BackColor = 221,227,252, ;
		BackStyle = 1, ;
		BorderColor = 0,51,153, ;
		Curvature = 15, ;
		Height = 395, ;
		Left = 0, ;
		Name = "Shape1", ;
		Top = 34, ;
		Width = 414, ;
		ZOrderSet = 0
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'Shape2' AS _shape WITH ;
		Anchor = 11, ;
		BackColor = 221,227,252, ;
		BackStyle = 1, ;
		BorderStyle = 0, ;
		Curvature = 15, ;
		Height = 34, ;
		Left = 1, ;
		Name = "Shape2", ;
		Top = 35, ;
		Width = 413, ;
		ZOrderSet = 1
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'Shape3' AS _shape WITH ;
		Anchor = 11, ;
		BackColor = 221,227,252, ;
		BackStyle = 1, ;
		BorderStyle = 0, ;
		Curvature = 0, ;
		Height = 18, ;
		Left = 1, ;
		Name = "Shape3", ;
		Top = 51, ;
		Width = 412, ;
		ZOrderSet = 3
		*< END OBJECT: ClassLib="_baza.vcx" BaseClass="shape" />

	ADD OBJECT 'shpPage' AS container WITH ;
		Height = 307, ;
		Left = 6, ;
		Name = "shpPage", ;
		Top = 73, ;
		Width = 402, ;
		ZOrderSet = 7
		*< END OBJECT: BaseClass="container" />

	ADD OBJECT 'shpPage.Label2' AS label WITH ;
		BackStyle = 0, ;
		Caption = "Drop a pageframe ONTOP of this control and size it the same as the grey area. Set the following properties: TABNUMBER = number of tabs of the page frame. TABCAPTIONSTR= Comma delimited list of the captions to display on the tabs.", ;
		ForeColor = 0,0,255, ;
		Height = 61, ;
		Left = 6, ;
		Name = "Label2", ;
		Top = 79, ;
		Width = 385, ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'shpPage.Label3' AS label WITH ;
		BackStyle = 0, ;
		Caption = "Set TABBMPSTR= Comma delimited list of thebitmaps to display on the tabs. Set OTAB2USE to the current tab name as shown.eg ThisForm.pagTabs. If there are any actions to be created, open ACTIONS.DBF and fill in records.", ;
		ForeColor = 128,128,0, ;
		Height = 61, ;
		Left = 6, ;
		Name = "Label3", ;
		Top = 146, ;
		Width = 385, ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'shpPage.Label4' AS label WITH ;
		BackStyle = 0, ;
		Caption = "SEE THE ZREADME METHOD FOR COMPLETE DOCUMENTATION.", ;
		ForeColor = 128,0,0, ;
		Height = 24, ;
		Left = 6, ;
		Name = "Label4", ;
		Top = 242, ;
		Width = 385, ;
		WordWrap = .T.
		*< END OBJECT: BaseClass="label" />

	ADD OBJECT 'Tab1' AS bluetabh WITH ;
		Left = 24, ;
		Name = "Tab1", ;
		Picture = ..\grafice\dbtabh4.bmp, ;
		Top = 1, ;
		Visible = .T., ;
		ZOrderSet = 8, ;
		cmdTab.Name = "cmdTab", ;
		Image1.Name = "Image1", ;
		Image1.Picture = ..\grafice\lbtabh3.bmp, ;
		Image2.Name = "Image2", ;
		Image2.Picture = ..\grafice\note.gif, ;
		Label1.ForeColor = 0,51,153, ;
		Label1.Name = "Label1"
		*< END OBJECT: ClassLib="bbtabs.vcx" BaseClass="container" />
	
	PROCEDURE changehyperlinks		&& changes the links at bottom
	ENDPROC

	PROCEDURE entermouse		&& called by mouse entering a tab
		LPARAMETERS toTab
		* store the original bmp
		
		This.lasttabbmp = toTab.image1.picture 
		toTab.image1.picture = "OtabH3.bmp"
	ENDPROC

	PROCEDURE Init
		WITH This
			* remove the placeholder
			.RemoveObject("shpPage")
			* setup the action links below
		*!*		.SetupActions(1)
			* sets up the array with labels
			.SetupArrays()
			* setup the tabs above
			.SetupTabs()
			* Set the caption for the first tab
			.lblHeader.Caption = This.TabCaptions[This.activetab]
			* Activate the correct tab
			IF NOT EMPTY(This.oTab2Use)
				LOCAL oTabx
				oTabx = EVALUATE(This.oTab2Use)
				oTabx.Tabs = .F.
				oTabx.Themes = .F.
			ENDIF
			
		ENDWITH
	ENDPROC

	PROCEDURE leavemouse		&& called by mouse leaving a tab
		LPARAMETERS toTab
		* store the saved bmp
		toTab.image1.picture = This.lasttabbmp
		
	ENDPROC

	PROCEDURE setupactions		&& Sets up the action links below. Requires a table called Actions.dbf
		* sets up the action Hyperlinks at the bottom.
		LPARAMETERS tnTabno
		*!*	IF EMPTY(tnTabno)
		*!*		tnTabno = 1
		*!*	ENDIF
		*!*	* sets up the action section below
		*!*	IF NOT USED("actions")
		*!*		USE actions IN 0 SHARED
		*!*	ENDIF
		*!*	SELECT actions
		*!*	LOCAL cnt
		*!*	* only 2 actions allowed
		*!*	FOR cnt = 1 TO 2
		*!*		oAct = EVALUATE("This.Bottomactioncontainerh1.Tabhyperlink"+TRANSFORM(cnt))
		*!*		oAct.Visible = .F.
		*!*		*WAIT WINDOW oAct.name
		*!*	ENDFOR
		*!*	cnt = 1
		
		*!*	SCAN FOR UPPER(formname) = UPPER(ThisForm.name) AND tabnumber = tnTabno AND NOT EMPTY(caption)
		*!*		*WAIT WINDOW oAct.name +" in scan loop"
		*!*		oAct = EVALUATE("This.Bottomactioncontainerh1.Tabhyperlink"+TRANSFORM(cnt))
		*!*		IF VARTYPE(oAct) = "O"
		*!*			WITH oAct 
		*!*				.Visible = .T.
		*!*				IF NOT EMPTY(icon)
		*!*					.Image2.Picture = ALLTRIM(icon)
		*!*					.Image2.Visible = .T.
		*!*				ELSE
		*!*					.Image2.Visible = .F.
		*!*				ENDIF
		*!*				IF NOT EMPTY(caption)
		*!*					.Label1.Caption = ALLTRIM(caption)
		*!*					.Label1.Visible = .T.
		*!*				ELSE
		*!*					.Label1.Visible = .F.
		*!*				ENDIF
		*!*				.ActionEvent = ALLTRIM(action)
		*!*			ENDWITH
		*!*		ENDIF
		*!*		cnt = cnt + 1
		*!*		IF cnt > 2
		*!*			EXIT
		*!*		ENDIF
		*!*	ENDSCAN
		*!*	USE IN SELECT("actions")
	ENDPROC

	PROCEDURE setuparrays		&& sets up the array with the labels and bmps
		* setup the array of bmps & captions for the tabs
		LOCAL bb,startx,starty,bb,cc,endy
		startx=1
		starty = 1
		bb=This.tabcaptionstr
		cc=This.tabbmpstr  
		DIMENSION This.tabcaptions[This.tabnumber,2]
		nRows = ALINES(this.tabcaptions , bb, .F., ",")
		nRows = ALINES(this.tabbmps , cc, .F., ",")
		bb=10
	ENDPROC

	PROCEDURE setuptabs		&& Sets up the tabs based on properties
		LOCAL cnt,cPic,Cap
		IF NOT "BBTABS"$SET("Classlib")
			SET CLASSLIB TO bbtabs ADDITIVE
		ENDIF
		* GET number of tabs
		nLeft = This.Tab1.Left
		nTop = This.Tab1.Top
		FOR cnt = 1 TO This.Tabnumber
			* skip if first tab
			IF cnt>1
				This.AddObject("Tab"+TRANSFORM(cnt),"bluetabh")
			ENDIF
			oTab = EVALUATE("This.tab"+TRANSFORM(cnt))
			WITH oTab
				cPic = This.tabbmps[cnt]
				.Image2.Picture = cPic
				cCap = This.tabcaptions[cnt]
		
				* larger caption = larger tab
				lnlen = LEN(STRTRAN(ALLTRIM(cCap),' ',''))
				lnfontsize = .label1.fontsize
				IF lnLen*lnfontsize > .image1.width
					.image1.width = lnLen*lnfontsize
					.width = lnLen*lnfontsize
					.cmdtab.width = lnLen*(lnfontsize-1)
				ENDIF 	
				* larger caption = larger tab
				
				.Label1.Caption = cCap
				.Left = nLeft
				.Top = nTop
				.Visible = .T.
				.Zorder(1)
				nLeft = nLeft+ .Width -8
			ENDWITH
		ENDFOR
		* activate the tab
		oTab = EVALUATE("This.tab"+TRANSFORM(This.activetab))
		oTab.Zorder(0)
	ENDPROC

	PROCEDURE showhelp		&& sets up help
	ENDPROC

	PROCEDURE tabclicked		&& Run when a tab is clicked. Usually sets the current tab.
		LPARAMETERS toTab
		LOCAL LCA,LCnR
		STORE '' TO LCA,LCnR
		LCA  = toTab.name
		DO WHILE  !ISALPHA(SUBSTR(LCA,LEN(LCA),1))
			LCnR = RIGHT(LCA,1)+LCnR
			LCA = LEFT(LCA,LEN(LCA)-1)
		ENDDO 
		nTab = VAL(LCnR)
		ThisForm.lockscreen = .T.
		* Activate the correct tab
		IF NOT EMPTY(This.oTab2Use)
			LOCAL oTabx
			oTabx = EVALUATE(This.oTab2Use)
			This.tabnumber = oTabx.PageCount
			oPage = EVALUATE("oTabx.Page"+TRANSFORM(nTab))
			IF oPage.Enabled
				oTabx.ActivePage = nTab
			ELSE
				WAIT WINDOW NOWAIT "Page is disabled"
				RETURN
			ENDIF
		ELSE
			RETURN
		ENDIF
		This.activetab = nTab
		
		* Caption
		This.lblHeader.Caption = This.TabCaptions[nTab]		&&EVALUATE("This.TabCaption"+TRANSFORM(nTab))
		LOCAL cnt
		FOR cnt = 1 TO This.Tabnumber		&& STEP -1
			oTab = EVALUATE("This.Tab"+TRANSFORM(cnt))
			* reset all to blue
			IF "LBTABH"$UPPER(oTab.Image1.Picture)
				oTab.Image1.Picture = 'dbtabh3.bmp'		&&'pics\bluetabh.bmp'
				oTab.Label1.Forecolor = RGB(255,255,255)
			ENDIF
			* send the button back in order
			oTab.Zorder(1)
		ENDFOR
		* change the clicked tab picture and bring to front
		toTab.image1.picture = 'lbtabh4.bmp'		&&'pics\Lbluetabh.bmp'
		toTab.Label1.Forecolor = RGB(0,51,153)
		toTab.zorder(0)
		
		* do stuff when page changes
		This.setupActions(nTab)
		
		ThisForm.lockscreen = .F.
	ENDPROC

	PROCEDURE zreadme		&& Readme for this class usage
		TEXT TO xxx NOSHOW
		To use this control:
		1. Drop a Pageframe ON TOP of this control. Do NOT place in inside this control's container.
		2. Set the foll Props:
			TABCAPTIONSTR = A comma delimited string in sequential order of the captions to be displayed on the tabs.
			TABBMPSTR = A comma delimited string of the names of the bitmaps to display on the tabs.
			oTAB2USE = The full path to the tab that has been dropped in step 1 - eg. ThisForm.pgMyTabs
		3. If there are any actions to be created for each tab, open ACTIONS.DBF and create them as shown in the table.
		These actions will appear in the space below the tabs. It is not necessary but looks better with actions which 
		can be something like calling the click event on a button etc.
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		ENDTEXT
	ENDPROC

ENDDEFINE

DEFINE CLASS tabhyperlink AS _container OF "..\..\comun\clase\_baza.vcx" 
 	*< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

	*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
	*< OBJECTDATA: ObjPath="Image2" UniqueID="" Timestamp="" />
	*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />

	*<DefinedPropArrayMethod>
		*p: actionevent
		*p: _memberdata		&& XML Metadata for customizable properties
	*</DefinedPropArrayMethod>

	*<PropValue>
		actionevent = 
		BackStyle = 0
		BorderWidth = 0
		Height = 18
		Name = "tabhyperlink"
		Width = 200
		_memberdata = <VFPData>
			<memberdata name="actionevent" type="property" display="ActionEvent"/>
		</VFPData>
	*</PropValue>

	ADD OBJECT 'Image2' AS _image WITH ;
		Anchor = 4, ;
		BackStyle = 0, ;
		Height = 12, ;
		Left = 2, ;
		Name = "Image2", ;
		Picture = addressbook.bmp, ;
		Top = 0, ;
		Width = 15
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="image" />

	ADD OBJECT 'Label1' AS _label WITH ;
		Anchor = 4, ;
		AutoSize = .F., ;
		BackStyle = 0, ;
		Caption = "Open the Address book", ;
		FontUnderline = .T., ;
		ForeColor = 0,0,255, ;
		Height = 17, ;
		Left = 28, ;
		MousePointer = 15, ;
		Name = "Label1", ;
		Top = 0, ;
		Width = 170
		*< END OBJECT: ClassLib="..\..\comun\clase\_baza.vcx" BaseClass="label" />
	
	PROCEDURE Label1.Click
		IF NOT EMPTY(This.Parent.ActionEvent)
			cCmd = This.Parent.ActionEvent
			&cCmd
		ENDIF
	ENDPROC

ENDDEFINE
