Extension Modules > IUP

IUP Linux and Windows

<< < (7/10) > >>

Support:
Here is the tabs.c IUP C example converted to ScriptBasic. I think Gtk (Linux) does a better job of vertical tabs.

C Version


--- Code: ---' Iup::Tabs: Example in ScriptBasic
' Creates a Iup::Tabs control.

IMPORT iup.bas

GLOBAL CONST IUP_CENTER = 0xFFFF

Iup::Open()

vbox1 = Iup::Vbox(Iup::Label("Inside Tab A"), Iup::Button("Button A", ""))
vbox2 = Iup::Vbox(Iup::Label("Inside Tab B"), Iup::Button("Button B", ""))

Iup::SetAttribute(vbox1, "TABTITLE", "Tab A")
Iup::SetAttribute(vbox2, "TABTITLE", "Tab B")

tabs1 = Iup::Tabs(vbox1, vbox2)

vbox1 = Iup::Vbox(Iup::Label("Inside Tab C"), Iup::Button("Button C", ""))
vbox2 = Iup::Vbox(Iup::Label("Inside Tab D"), Iup::Button("Button D", ""))

Iup::SetAttribute(vbox1, "TABTITLE", "Tab C")
Iup::SetAttribute(vbox2, "TABTITLE", "Tab D")

tabs2 = Iup::Tabs(vbox1, vbox2)
Iup::SetAttribute(tabs2, "TABTYPE", "LEFT")

box = Iup::Hbox(tabs1, tabs2)
Iup::SetAttribute(box, "MARGIN", "10x10")
Iup::SetAttribute(box, "GAP", "10")

dlg = Iup::Dialog(box)
Iup::SetAttribute(dlg, "TITLE", "IupTabs")
Iup::SetAttribute(dlg, "SIZE", "200x80")

Iup::ShowXY (dlg, IUP_CENTER, IUP_CENTER)
Iup::MainLoop ()
Iup::Close ()

END

--- End code ---



Support:
I have been working on adding the additional controls and the CD (canvas draw library) to the ScriptBasic IUP binding. This should add some interesting features to the SciptBasic language offering.






Dials





Support:
Here is the matrix.c example converted to ScriptBasic.

C Version


--- Code: ---IMPORT iup.bas

GLOBAL CONST IUP_CENTER = 0xFFFF

FUNCTION create_mat
  mat = Iup::Matrix()
 
  Iup::SetAttribute(mat,"NUMCOL","20")
  Iup::SetAttribute(mat,"NUMLIN","30")
 
  Iup::SetAttribute(mat,"NUMCOL_VISIBLE","2")
  Iup::SetAttribute(mat,"NUMLIN_VISIBLE","3")
 
  Iup::SetAttribute(mat,"0:0","Inflation")
  Iup::SetAttribute(mat,"1:0","Medicine")
  Iup::SetAttribute(mat,"2:0","Food")
  Iup::SetAttribute(mat,"3:0","Energy")
  Iup::SetAttribute(mat,"0:1","January 2000")
  Iup::SetAttribute(mat,"0:2","February 2000")
  Iup::SetAttribute(mat,"1:1","5.6")
  Iup::SetAttribute(mat,"2:1","2.2")
  Iup::SetAttribute(mat,"3:1","7.2")
  Iup::SetAttribute(mat,"1:2","4.5")
  Iup::SetAttribute(mat,"2:2","8.1")
  Iup::SetAttribute(mat,"3:2","3.4")
  Iup::SetAttribute(mat,"RESIZEMATRIX","YES")
  Iup::SetAttribute(mat,"MARKMODE","LINCOL")
  Iup::SetAttribute(mat,"MULTIPLE","YES")
  Iup::SetAttribute(mat,"AREA","NOT_CONTINUOUS")

  create_mat = mat
END FUNCTION


' Main program

  Iup::Open()       
  Iup::ControlsOpen()

  dlg = Iup::Dialog(create_mat())
  Iup::SetAttribute(dlg, "TITLE", "IupMatrix")
  Iup::ShowXY(dlg,IUP_CENTER,IUP_CENTER)
  Iup::MainLoop ()
  Iup::Close () 
END

--- End code ---


Support:
BUILD 10

This release includes the additional IUP controls, cd (canvas draw) with OpenGL support. I will be exposing the cd functions in the next release under its own module cd:: in the iup.bas import file.


--- Quote ---CD is a platform-independent graphics library. Its drivers are implemented in several platforms, some use portable code, others use native graphics libraries, such as Microsoft Windows (GDI and GDI+) and X-Windows (XLIB).

The library contains functions to support both vector and image applications, and the visualization surface can be either a canvas or a more abstract surface, such as Clipboard, Metafile, PS, and so on.

Furthermore, the list of parameters of the CD primitive functions contains only the geometrical descriptions of the objects (line, circle, text, etc.). Where these objects should appear and what is the their color, thickness, etc. are defined as current state variables stored in the visualization surfaces. That is, the library is visualization-surface oriented, meaning that all attributes are stored in each visualization surface.

--- End quote ---

 I setup a Ubuntu 11.10 32 bit instance on Amazon and compiled a SB IUP extension module for 32 bit Linux. I haven't tested it yet but it compiled fine. I have to setup a vnc remote desktop with my EC2 instance and haven't had time to do that yet. If someone running a 32 version of Ubuntu can give this a quick try, it would be appreciated. If you need a 32 bit Linux runtime version of ScriptBasic, you can get it HERE.

You may have noticed there is no Windows version of Build 10. I have to rebuild my Windows IUP setup and with the little interest on that platform, Windows can wait until I get around to it. There are so many versions of Basic for Windows, it's hard for me to justify investing much time to that platform.

Support:
It may seem slow going with getting the ScriptBasic IUP binding done but I'm taking my time to make sure the interface remains a natural extension to the language keeping it's typeless high level functionality intact. The cd graphics side of this is going to be a lot of fun based on what I have read so far in the IUP CD documentation. The IM (Image Representation, Storage, Capture and Processing) part of the IUP binding is the last installment to complete.

I hope the OS X native driver is released soon. Gtk on the Mac is a temporary solution IMO.

 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version