Programmable Grid Component

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
RhodyRich
Posts: 6
Joined: Apr 08, 2015 16:16

Programmable Grid Component

Post by RhodyRich »

Are there programmable grid components that can be used to add spreadsheet functionality to a FreeBasic application? If so, are there examples available using any such components with FreeBasic?
WQ1980
Posts: 48
Joined: Sep 25, 2015 12:04
Location: Russia

Re: Programmable Grid Component

Post by WQ1980 »

RhodyRich wrote:Are there programmable grid components that can be used to add spreadsheet functionality to a FreeBasic application? If so, are there examples available using any such components with FreeBasic?
Maybe IupMatrix of IUP

http://webserver2.tecgraf.puc-rio.br/iup/

Code: Select all

' matrix.bas
#Include "inc/iup.bi"
#Include "inc/iupcontrols.bi"


Sub _init Constructor
	IupOpen(0,0)
	IupControlsOpen()
End Sub


Function create_mat() As Ihandle Ptr

	Dim As Ihandle Ptr mat = IupMatrix(NULL)

	IupSetAttribute(mat,"NUMCOL","20")
	IupSetAttribute(mat,"NUMLIN","30")

	IupSetAttribute(mat,"NUMCOL_VISIBLE","2")
	IupSetAttribute(mat,"NUMLIN_VISIBLE","3")

	IupSetAttribute(mat,"0:0","Inflation")
	IupSetAttribute(mat,"1:0","Medicine")
	IupSetAttribute(mat,"2:0","Food")
	IupSetAttribute(mat,"3:0","Energy")
	IupSetAttribute(mat,"0:1","January 2000")
	IupSetAttribute(mat,"0:2","February 2000")
	IupSetAttribute(mat,"1:1","5.6")
	IupSetAttribute(mat,"2:1","2.2")
	IupSetAttribute(mat,"3:1","7.2")
	IupSetAttribute(mat,"1:2","4.5")
	IupSetAttribute(mat,"2:2","8.1")
	IupSetAttribute(mat,"3:2","3.4")
	'  IupSetAttribute(mat,"WIDTHDEF","34")
	IupSetAttribute(mat,"RESIZEMATRIX","YES")
	'  IupSetAttribute(mat,"MARKMODE","CELL")
	IupSetAttribute(mat,"MARKMODE","LINCOL")
	IupSetAttribute(mat,"MULTIPLE","YES")
	IupSetAttribute(mat,"AREA","NOT_CONTINUOUS")
	Return mat
End Function


Var mat = create_mat()

Var vbox = IupVbox(NULL)
IupAppend(vbox, mat)
	
Dim As Ihandle  Ptr dlg = IupDialog(vbox)


IupSetAttribute(dlg, "TITLE", "IupMatrix")
IupShowXY (dlg,IUP_CENTER,IUP_CENTER)
IupMainLoop()

RhodyRich
Posts: 6
Joined: Apr 08, 2015 16:16

Re: Programmable Grid Component

Post by RhodyRich »

Where can I find the iup.bi and iupcontrols.bi files?
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Programmable Grid Component

Post by St_W »

They are included with FreeBasic (in the "inc/IUP" subdirectory). See https://github.com/freebasic/fbc/tree/master/inc/IUP

If you don't have the include directory or it doesn't contain the IUP headers you can download a ZIP with all the headers (including IUP) here:
http://users.freebasic-portal.de/stw/bu ... eaders.zip
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Programmable Grid Component

Post by dodicat »

They are in the freebasic inc\iup folder.
E.G.
FreeBASIC-1.05.0-win32\inc\IUP

Call them by:

#Include "iup/iup.bi"
#Include "iup/iupcontrols.bi"
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Programmable Grid Component

Post by srvaldez »

jcfuller
Posts: 325
Joined: Sep 03, 2007 18:40

Re: Programmable Grid Component

Post by jcfuller »

I just discovered the old 32bit Farpoint 3.0 grid is available for free from ComponentOne:
http://our.componentone.com/groups/topi ... windows-7/
Scroll down the page a ways to find a current working link.
I used this control for all of my commercial work with PowerBASIC back in the day!!
It should work fine with FreeBasic 32bit?

James
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: Programmable Grid Component

Post by PaulSquires »

The problem with most of those Windows grid controls is that they are not high DPI aware. Using the grids at different non-standard (96dpi) settings may screw up the functionality of the grid.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Programmable Grid Component

Post by srvaldez »

hello Paul
is your FBGrid control ready for use?
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: Programmable Grid Component

Post by PaulSquires »

srvaldez wrote:hello Paul
is your FBGrid control ready for use?
Not yet :) Working on completing the WinFBE editor first and then it will be completing the grid control.
Post Reply