IUP 3.5 Windows / Linux (BSD too) GUI Headers Available

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

IUP 3.5 Windows / Linux (BSD too) GUI Headers Available

Post by sir_mud »

Headers located here:
Source control: http://code.google.com/p/freebasic-head ... inc%2FIUP3
Download: http://code.google.com/p/freebasic-head ... s-only.zip

For more info including libs and examples see AGS' excellent thread here: http://www.freebasic.net/forum/viewtopic.php?t=14230
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

This are a complete rewrote (fixed many wrong declares) and is a more complete IUP package for FreeBASIC.

IUP 3.5
Windows: fbIUP3.5Windows.7z
Linux: fbIUPLinux.tar.gz
Last edited by D.J.Peters on Jun 18, 2013 16:47, edited 8 times in total.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

#inclib "shell32"
#inclib "advapi32"

are missing in "iup.bi"

Joshy
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

(edit)
Last edited by D.J.Peters on Nov 23, 2012 7:37, edited 6 times in total.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

(edit)
Last edited by D.J.Peters on Nov 23, 2012 7:37, edited 2 times in total.
Drago
Posts: 116
Joined: Aug 10, 2005 13:15

Post by Drago »

double define in IupControls.bi

Code: Select all

declare function IupColorBrowser () as Ihandle ptr
tabs.c works fine

Code: Select all

#libpath "lib/"
#include "inc/IUP3/iup.bi"

#ifndef NULL
#define NULL cptr(ANY PTR,0)
#endif

' Initializes IUP
sub _init constructor
  IupOpen(0,0)
end sub
' Finishes IUP 
sub _exit destructor
  IupClose()
end sub
'
' main
'
' IUP identifiers 
dim as Ihandle ptr dialog, vbox1, vbox2, tabs1, tabs2, box

  vbox1 = IupVbox(IupLabel("Inside Tab A"), IupButton("Button A", ""), NULL)
  vbox2 = IupVbox(IupLabel("Inside Tab B"), IupButton("Button B", ""), NULL)

  IupSetAttribute(vbox1, "TABTITLE", "Tab A")
  IupSetAttribute(vbox2, "TABTITLE", "Tab B") 
  
  tabs1 = IupTabs(vbox1, vbox2, NULL)
  IupSetAttribute(tabs1, "SIZE", "200x100")

  vbox1 = IupVbox(IupLabel("Inside Tab C"), IupButton("Button C", ""), NULL)
  vbox2 = IupVbox(IupLabel("Inside Tab D"), IupButton("Button D", ""), NULL)

  IupSetAttribute(vbox1, "TABTITLE", "Tab C")
  IupSetAttribute(vbox2, "TABTITLE", "Tab D")

  tabs2 = IupTabs(vbox1, vbox2, NULL)
  IupSetAttribute(tabs2, "TABTYPE", "LEFT")

  box = IupHbox(tabs1, tabs2, NULL)
  IupSetAttribute(box, "MARGIN", "10x10")
  IupSetAttribute(box, "GAP", "50")

  dialog = IupDialog(box)
  IupSetAttribute(dialog, "TITLE", "IupTabs")
  IupSetAttribute(dialog, "SIZE", "400x140")
  IupShowXY (dialog, IUP_CENTER, IUP_CENTER)


  IupShow( dialog )
  IupMainLoop()
while

matrix.c will not *sniff*

Code: Select all

#libpath "lib/"
#include "inc/IUP3/iup.bi"
#include "inc/IUP3/iupcontrols.bi"

#ifndef NULL
#define NULL cptr(ANY PTR,0)
#endif

' Initializes IUP
sub _init constructor
  IupOpen(0,0)
  IupControlsOpen()
end sub
' Finishes IUP 
sub _exit destructor
  IupClose()
end sub
'
' main
'
' IUP identifiers 
dim as Ihandle ptr dialog, mat
  
  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")


  dialog = IupDialog(mat)
  IupSetAttribute(dialog, "TITLE", "IupMatrix")
  IupSetAttribute(dialog, "SIZE", "400x400")
  IupShowXY (dialog, IUP_CENTER, IUP_CENTER)


  IupShow( dialog )
  IupMainLoop()
Grüße
Rainer
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

@Drago
the static libs are not complete (and only for testing in FBIUP.zip)
for your example you need the dynamic libs
"cd.dll, iup.dll, iupcd.dll, iupcontrols.dll"

For all Microsoft compilers (VS6,8,9...) the static libs are more complete
but not for gcc and mingw (the format of FreeBASIC too).

I dont spent more time in IUP i don't like all the attributes and properties as STRING values.

Joshy

the result from your example are:
Image
Last edited by D.J.Peters on Oct 03, 2017 5:26, edited 2 times in total.
Drago
Posts: 116
Joined: Aug 10, 2005 13:15

Post by Drago »

Well yes, I saw the missing canvas defines...

I was interested in this only because I'm still looking for a Grid Control to use on Windows and Linux.

My main hope was your oop-wx port, it looks very good so far......maybe one day :)

Grüße
Rainer
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Post by sir_mud »

Thanks for testing these out, I'll get the fixes you've done merged in. I didn't notice any defines that would duplicate but I didn't look real hard for a simple example to test them. The functions are all in extern "c" blocks so they should work as is.
Bunuel66
Posts: 76
Joined: May 19, 2006 19:56

IUP Lib 3.5

Post by Bunuel66 »

I try to use the IUP lib 3.5 with the include provided and I still get the duplicated definition problem.

Duplicated definition, K_a in '#define K_a asc("a")'

Does anybody has a set of working include file?

Regards
Bunuel66
Posts: 76
Joined: May 19, 2006 19:56

IUP

Post by Bunuel66 »

Patching a couple of .bi files makes life easier. Anybody interested?
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Post by Merick »

Bunuel, the problem is that unlike c, FB is not case sensitive. I.E. in FB, K_A is the same as K_a. To fix this, you can just go through and add and extra underscore to the capitals, K_A -> K_A_, K_B -> K_B_, etc..
Bunuel66
Posts: 76
Joined: May 19, 2006 19:56

IUP

Post by Bunuel66 »

Thank's for the answer. I have already corrected the files. Seems to work.
Does anybody has created the files for the CD lib of tecgraf? This is a nice complement to IUP.

Regards
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Post by Merick »

The defines in iupkey.bi really should be fixed in the download package, otherwise people will be coming up with their own alternate defines for the upper and lowercase letters, which will cause confusion if they try to share their code with someone who has done it in a different way.

My suggestion would be to put an L or U after the K to indicate the case: KU_A, KL_a, etc...
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Post by Merick »

In iup.bi, this:

type Icallback as function cdecl(byval as Ihandle ptr) as integer

should be changed to:

type Icallback as function cdecl(byval as Ihandle ptr, ...) as integer


Adding the ellipses will remove the need to use cast on the function pointer to prevent the "Passing different pointer types" compiler warning when setting a callback function.
Post Reply