Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vertical Text in a Vertical TAB
Message
 
À
26/04/2016 17:24:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01635376
Message ID:
01635468
Vues:
135
Thank you for the code !

Tommy

>
>*this simple demo  code simulates a form pageframe with tabOrientation=3 (right border)
>*the tabs are superstaded by commandbuttons here (can be images,labels, containers..)
>*can also add picture on commandbutton positionned with pictureposition property .
>*see the pageframe.init, bindevents code  and avoid some cosmetics....
>
>Publi yform
>yform=Newobject("ypgf")
>yform.Show
>Read Events
>Retu
>*
>Define Class ypgf As Form
>	Top = 0
>	Left = 0
>	Height = 600
>	Width = 750
>	Caption = "Pageframe with TabOrientation=3 & commandbuttons as TABS"
>	Name = "Form1"
>
>	Add Object pageframe1 As PageFrame With ;
>		ErasePage = .T., ;
>		PageCount = 4, ;
>		Top = 3, ;
>		Left = 21, ;
>		Width = 648, ;
>		Height = 461+50, ;
>		TabOrientation = 3, ;
>		Name = "Pageframe1", ;
>		Page1.Caption = "Page1", ;
>		Page1.BackColor = Rgb(128,255,0), ;
>		Page1.Name = "Page1", ;
>		Page2.Caption = "Page2", ;
>		Page2.Name = "Page2", ;
>		Page3.Caption = "Page3", ;
>		Page3.Name = "Page3", ;
>		Page4.Caption = "Page4", ;
>		Page4.Name = "Page4"
>
>	Procedure ybind
>	Lparameters nButton, nShift, nXCoord, nYCoord
>*--- aevent create an array laEvents
>	Aevents( myArray, 0)
>*--- reference the calling object
>	loObject = myArray[1]
>	oo="thisform.pageframe1.page"+  Right(Alltrim(loObject.Parent.Name) ,1)   &&if tabs<=9  otheriwse rweek this line
>	ss=oo+".setfocus"
>	&ss
>	ss=oo+".activate"
>	&ss
>
>*colorize yemporarly background of active page
>	oo=Eval(oo)
>	Thisform.pageframe1.Themes=.F.
>	oo.BackColor=Rgb(255*Rand(),255*Rand(),255*Rand())
>	Inke(0.5)
>	Thisform.pageframe1.Themes=.T.
>	Endproc
>
>	Procedure Init
>	Declare Integer Sleep In kernel32 Integer
>
>	For i=1 To This.pageframe1.PageCount
>		Bindevent(Eval("thisform.ylab"+Transform(i)),"mousedown",Thisform,"ybind")
>	Endfor
>	Endproc
>
>	Procedure Destroy
>	Clea Events
>	Endproc
>
>	Procedure pageframe1.Init
>	Thisform.AddProperty("oheight",47)
>	With This
>		.Tabs=.T.
>		xorientation=This.TabOrientation
>		xtop=This.Top
>		xwidth=This.Width/This.PageCount
>		xheight=This.Height/This.PageCount
>		.TabOrientation=3
>
>		For i=1 To .PageCount
>			.Pages(i).Caption=""
>			Thisform.AddObject("ylab"+Trans(i),"commandbutton")
>			With Eval("thisform.ylab"+Trans(i))
>				.Caption="Mypage"+Trans(i)
>				.WordWrap=.T.
>				.SpecialEffect=2
>				.mousePointer=15
>
>				.FontBold=.T.
>				.FontSize=9
>*!* .backColor=Rgb(255*Rand(),255*Rand(),255*Rand())  &&can uncomment
>				.Top= Int(i-1)*xheight
>				.Width=Thisform.oheight
>				.Height=xheight
>				.Left= Thisform.pageframe1.Width-27
>*******************
>*vertical caption style
>				m.oo=""
>				For j=1 To Len(.Caption)
>					m.oo=m.oo+Substr(.Caption,j,1)+Chr(13)
>				Endfor
>				.Caption=m.oo
>*******************
>				.Visible=.T.
>			Endwith
>		Endfor
>	Endwith
>	Endproc
>
>
>Enddefine
>*
>*-- EndDefine:ypgf
>
Tommy Tillman A+ NetWork+ MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform