GdiplusX functions help

Published on by Yousfi Benameur


 this tool can import all functions enumerated in system.drawing.prg of gdiplusX (1035 functions) and show in the right browser.
these functions are listed in the order of their appearance in the library.
this list integrates also also the APIs declarations (gdiplus,gdi32 and others).

you can type a part of a function in the textbox (or paste clipboard by rightclick) to find it in the listbox and then can show it (if exists).

if the function refers to an msdn link ,the link is shown on the bottom label and can be clicked to show the relative web page in a new target window of the defaut navigator.
you can copy the  browser contents in the clipboard .
you need to regenerate the table only if there is some updates for ex. or if you run the form at the first time.(otherwise no need because a physical table is created in starting  folder (dbf+fpt)
I shipped a basic axample of kwown (or named) gdiplusX colors.

Must point mandatory to system.drawing.prg (shipped in gdiplusX project).
otherwise can download stable version 20   from the vfpx codeplex at:
https://vfpx.codeplex.com/downloads/get/69412


Click on code to select [then copy] -click outside to deselect

 
Publi yform
yform=Newobject("yghelp")
yform.Show
Read Events
Retu
*
Define Class yGhelp As Form
    BorderStyle = 3
	Height = 591
	Width = 961
	ShowWindow = 2
	ShowTips = .T.
	AutoCenter = .T.
	Caption = "Form1"
	MinHeight = 500
	MinWidth = 800
	BackColor = Rgb(186,205,239)
	Name = "Form1"

	Add Object text1 As TextBox With ;
		Height = 27, ;
		Left = 2, ;
		SelectOnEntry = .T., ;
		Top = 7, ;
		Width = 264, ;
		BackColor = Rgb(188,242,252), ;
		Name = "Text1"

	Add Object list1 As ListBox With ;
		RowSourceType = 6, ;
		RowSource = "yfunctions_sd.Yfunction", ;
		ControlSource = "", ;
		Height = 452, ;
		Left = 4, ;
		MousePointer = 15, ;
		Sorted = .F., ;
		Top = 40, ;
		Width = 265, ;
		ItemTips = .T., ;
		Name = "List1"

	Add Object label1 As Label With ;
		FontBold = .T., ;
		FontSize = 10, ;
		Anchor = 768, ;
		Alignment = 2, ;
		BackStyle = 0, ;
		Caption = "", ;
		Height = 25, ;
		Left = 2, ;
		Top = 511, ;
		Width = 147, ;
		ForeColor = Rgb(255,0,0), ;
		Name = "Label1"

	Add Object image1 As Image With ;
		Anchor = 768, ;
		Picture = Home(1)+"graphics\bitmaps\tlbr_w95\copy.bmp", ;
		Stretch = 2, ;
		BackStyle = 0, ;
		Height = 32, ;
		Left = 219, ;
		Top = 506, ;
		Width = 32, ;
		Name = "Image1"


	Add Object image2 As Image With ;
		Anchor = 768, ;
		Picture = Home(1)+"graphics\bitmaps\tlbr_w95\help.bmp", ;
		Stretch = 2, ;
		BackStyle = 1, ;
		Height = 32, ;
		Left = 183, ;
		Top = 506, ;
		Width = 32, ;
		Name = "Image2"

	Add Object image3 As Image With ;
		Anchor = 768, ;
		Picture = Home(1)+"graphics\bitmaps\tlbr_w95\spelling.bmp", ;
		Height = 16, ;
		Left = 160, ;
		MousePointer = 15, ;
		Top = 514, ;
		Width = 16, ;
		ToolTipText = "Gdilplus colors sample", ;
		Name = "Image3"

	Add Object obrowser As OleControl With ;
		oleclass="shell.explorer.2",;
		Top = 2, ;
		Left = 276, ;
		Height = 538, ;
		Width = 685, ;
		Anchor = 15, ;
		Name = "oBrowser"

	Add Object ylab As Label With ;
		FontBold = .T., ;
		FontSize = 9, ;
		Anchor = 768, ;
		BackStyle = 0, ;
		Caption = "", ;
		Height = 25, ;
		Left = 283, ;
		MousePointer = 15, ;
		Top = 557, ;
		Width = 665, ;
		ForeColor = Rgb(255,0,0), ;
		Name = "yLab"

	Procedure Load
	Close Data All
	Do Locfile("system.app","app","Where is system.app ?")
	Set Safe Off
	Set Memowidth To 8192
	Local m.yrep
	m.yrep=Messagebox("Want to regenerate the functions table  yfunctions_sd (if any update-automatic the first time) ?",4+64+4096)
	If m.yrep=6 Or ! File("yfunctions_sd.dbf")
		Create Cursor ycurs (yfunction c(140),Code m)
		m.ystr=Filetostr( Locfile("system.drawing.prg","prg","Where is Drawing.drawing.prg ?") )

		i=0
		Do While .T.
			i=i+1
			m.x=Strextract(m.ystr,"FUNCTION","ENDFUNC" ,i,4)
			Wait Window (Substr(x,1,50)) At Srows()/2,Scols()/2-15 Nowait
			If Empty(m.x)
				Exit
			Endi

			Try
				Y=Substr(Allt(Mline(x,1)),9)
				Insert Into ycurs Values (m.y,m.x)
			Catch
			Endtry

			If Inkey()#0
				Exit
			Endi
		Enddo
		*brow
		Copy To yfunctions_sd
		Close Data All
	Endi


	Use yfunctions_sd
	This.Caption="GdiplusX library -"+ Trans(Reccount())+" gdiplusX functions -source :  sytem.drawing.prg "
	*brow
	Endproc


	Procedure Resize
	With Thisform.list1
		.Height=-.Top+Thisform.label1.Top-20
	Endwith
	Endproc

	Procedure text1.InteractiveChange
	Sele yfunctions_sd
	Locate For  Lower(Allt(This.Value))  ==   Lower(  Substr(Allt( yfunction),1,Len(Allt(This.Value))))
	If Found()
		Thisform.list1.InteractiveChange ()
	Endi
	Endproc

	Procedure text1.RightClick
	This.Value=_Cliptext
	Endproc

	Procedure text1.Init
	This.ToolTipText="Type a value to search-rightclick to paste clipboard."
	Endproc

	Procedure list1.InteractiveChange
	This.ListIndex=Recno()
	Endproc

	Procedure list1.Click
	thisform.ylab.caption=""
	
	Sele yfunctions_sd
	Thisform.text1.Value=This.Value

	Local m.xcode
	m.xcode="<center><h2>"+Allt(Thisform.text1.Value)+"</h2></center><br>"+Strtran(Code,Chr(13),"<br>")

	m.lcdest=Addbs(Sys(2023))+"yghelp.html"
	Local m.myvar
	TEXT to m.myvar textmerge noshow
		<style>
		.yp {
		color:navy;font-family:courier new;font-size:12px;font-height:bold;
		}

		</style>
		<body bgcolor=bisque oncontextmenu="return false;">
		<img src="https://download-codeplex.sec.s-msft.com/Download?ProjectName=vfpx&DownloadId=33709&Build=21031" style=width:80px;height:35px;float:right;">
		<div class="yp"> <<m.xcode>>  </div>
		</body>
	ENDTEXT

	Strtofile(m.myvar,m.lcdest)
	Thisform.obrowser.Navigate(m.lcdest)

	Thisform.label1.Caption="Function  "+Trans(Recno()) +" / "+Trans(Reccount())
	x=Strextract(Code,"http://",".aspx",1,4)
	If Not Empty(x)
		Thisform.ylab.Caption=x
	Else
		Thisform.ylab.Caption=""
	Endi
	Endproc


	Procedure image1.Init
	With This
		.Picture=Home()+"graphics\bitmaps\tlbr_w95\copy.bmp"
		.MousePointer=15
		.ToolTipText="Copy code to clipboard"
	Endwith
	Endproc

	Procedure image1.Click
	Try
		Local m.x
		m.x=Thisform.obrowser.Document.body.innertext
		If Len(m.x)>0
			_Cliptext=m.x
			Messagebox("The code is copied to the clipboard",0+32+4096,"Copy code",1000)
		Endi
	Catch
	Endtry
	Endproc

	Procedure image2.Click
	thisform.ylab.caption=""
	thisform.label1.caption=""
	Local m.myvar
	TEXT to m.myvar noshow
this tool can import all functions enumerated in system.drawing.prg<br>
of gdiplusX (1035 functions) and show in the right browser.<br>
these functions are listed in the order of their appearance in the library.<br>
this list integrates also also the APIs declarations (gdiplus,gdi32 and others).<br>

you can type a part of a function in the textbox (or paste clipbaord by rightclick)<br>
to find it in the listbox and then can show it (if exists).<br><br>

if the function refers to an msdn link ,the link is shown on the <br>
bottom label and can be clicked to show the relativeweb page in a new target <br>
window of the defaut navigator.<br>
you can copy the  browser contents in the clipboard .<br>
you need to re gerate the table only if there is some updates for ex.<br>
or if you run the form at the first time.(otherwise no need because <br>
a physical table is created)<br>
I shipped a basic axample of kwown (or named) gdiplusX colors.<br><br>
*!*--Original version published in Foxite<br>
*!*--Author Yousfi Benameur El Bayadh Algeria<br>
*!*--Time stamp samedi 17 septembre 2011; 21:49:03<br>
*!*--Subject :gdiplusX quick help<br>
*!*--Version Vfp9Sp2  windows xp sp3 --tested also on windows10 pro<br>
	ENDTEXT
	*messagebox(m.myvar,0+32+4096,"Summay help")
	mr=Strtran(m.myvar,Chr(13),"<br>")
	Local m.my
	TEXT to m.my textmerge noshow
<body bgcolor=bisque text=red oncontextmenu="return false;">
<img src="https://download-codeplex.sec.s-msft.com/Download?ProjectName=vfpx&DownloadId=33709&Build=21031" style=width:80px;height:35px;float:right;">
<br><br><br>
 <center><h2>GdiPlusX summary help</h2>
<div  style="color:purple" > <<m.myvar>> </div></center
</body>
	ENDTEXT
	Local m.lcdest
	m.lcdest=Addbs(Sys(2023))+"yghelp.html"
	Strtofile(m.my,m.lcdest)
	Thisform.obrowser.Navigate(m.lcdest)
	Endproc

	Procedure image2.Init
	With This
		.Picture=Home()+"graphics\bitmaps\tlbr_w95\help.bmp"
		.MousePointer=15
		.ToolTipText="Summary help"
	Endwith
	Endproc

	Procedure image3.Click
	*example
	*retrieve the known gdiplus colors on a table
	*the black colors are available only for the black color otherwise its another properties members
	With _Screen.System.drawing
		aa=.knowncolor  &&as object
		Amembers(gapropArray,m.aa,1)

		Create Cursor zcurs (ycolor  c(40),red i,green i,blue i,Draw c(20))
		Append From Array gapropArray

		Local xred,xgreen,xblue
		Scan
			xred=".color."+Allt(ycolor)+".R"
			xgreen=".color."+Allt(ycolor)+".G"
			xblue=".color."+Allt(ycolor)+".B"
			Wait Window m.xred  At Srows()/2,Scols()/2 Nowait

			Try
				Repl red With Evaluate(m.xred),green With Evaluate(m.xgreen)
				Repl blue With Evaluate(m.xblue),Draw With ""
			Catch
			Endtry

		Endscan
	Endwith

	Locate
	Browse  Name ybrow Title "The known GdiplusX Colors (black color is for ycolor=black only)" Nowait    &&window as oop object
	With ybrow
		.DeleteMark=.F.
		.GridLines=0
		.RecordMark=.F.
		.Columns(5).DynamicBackColor="RGB(red,green,blue)"
	Endwith
	Sele yfunctions_sd
	Retu
	Endproc

	Procedure obrowser.Init
	This.silent=.T.
	Endproc

	Procedure ylab.Click
	If Not Empty(This.Caption) And Lower(Substr(This.Caption,1,7))=="http://"
		Local o
		o=Newobject("hyperlink")
		o.NavigateTo(This.Caption)
	Endi
	Endproc
	
	Procedure destroy
	clea events
	endproc

Enddefine
*
*-- EndDefine: yGhelp
**************************************************



the vfpx logo gif image is shown only when internet is connected.Can download it and avoid this.
the vfpx logo gif image is shown only when internet is connected.Can download it and avoid this.
the vfpx logo gif image is shown only when internet is connected.Can download it and avoid this.

the vfpx logo gif image is shown only when internet is connected.Can download it and avoid this.

 
*Important:*the code above is tested on visual foxpro 9 sp2-under windows 10 pro

To be informed of the latest articles, subscribe:
Comment on this post