ScriptBasic
May 22, 2012, 02:34:13 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: The ScriptBasic User, Developer and extension module guides are available at the WIKI.
 
   Home   Wiki Help Search Login Register  
Pages: 1 2 [3] 4
  Print  
Author Topic: IUP Linux and Windows  (Read 3355 times)
support
Administrator
*****
Posts: 409


« Reply #30 on: January 10, 2012, 01:58:16 PM »

Quote
-If you can't get the dos window to close maybe you can get it to minimize as a work around?

You may be able to get rid of the console window start/close flash (using CIO::Detach) by setting the application to start minimized. (shortcut properties)

Update

The minimize trick solves the console flash issue but I was unable to get IUP to force the window to it's normal state under program control. (had to click on it in the taskbar)
« Last Edit: January 10, 2012, 03:34:18 PM by support » Logged
support
Administrator
*****
Posts: 409


« Reply #31 on: January 10, 2012, 05:18:54 PM »

I'm working on creating a scribaw for Windows that doesn't create a console window.

I'll post it to the downloads section when it's done.

Logged
support
Administrator
*****
Posts: 409


« Reply #32 on: January 13, 2012, 08:52:59 PM »

Here is the IUP sample.c converted to ScriptBasic.

C Version

Code:
' IUP sample.sb

IMPORT iup.bas

GLOBAL CONST IUP_CENTER = 0xFFFF
GLOBAL CONST IUP_TITLE = "TITLE"
GLOBAL CONST IUP_VALUE = "VALUE"
GLOBAL CONST IUP_SIZE = "SIZE"
GLOBAL CONST IUP_EXPAND = "EXPAND"
GLOBAL CONST IUP_DROPDOWN = "DROPDOWN"
GLOBAL CONST IUP_POSX = "POSX"
GLOBAL CONST IUP_POSY = "POSY"
GLOBAL CONST IUP_BGCOLOR = "BGCOLOR"
GLOBAL CONST IUP_MARGIN = "MARGIN"
GLOBAL CONST IUP_ALIGNMENT = "ALIGNMENT"
GLOBAL CONST IUP_GAP = "GAP"
GLOBAL CONST IUP_MENU = "MENU"

img_bits1 = """
 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1
,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2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iup::SetHandle ("img1", img)
  Iup::SetAttribute (img, "0", "0 0 0")
  Iup::SetAttribute (img, "1", "BGCOLOR")
  Iup::SetAttribute (img, "2", "255 0 0")

  img = Iup::Image(32,32, Iup::CreateImg(img_bits2))
  Iup::SetHandle ("img2", img)
  Iup::SetAttribute (img, "0", "0 0 0")
  Iup::SetAttribute (img, "1", "0 255 0")
  Iup::SetAttribute (img, "2", "BGCOLOR")
  Iup::SetAttribute (img, "3", "255 0 0")

  mnu = Iup::Menu( _
  Iup::Submenu("IupSubmenu 1",Iup::Menu( _
      Iup::SetAttributes(Iup::Item("IupItem 1 Checked"), "VALUE=ON"), _
      Iup::Separator(), _
      Iup::SetAttributes(Iup::Item("IupItem 2 Disabled"), "ACTIVE=NO"))), _
    Iup::Item("IupItem 3"), _
    Iup::Item("IupItem 4"))
  Iup::SetHandle("mnu",mnu)

  _frm_1 = Iup::Frame( _
    Iup::Vbox( _
      Iup::Button("Button Text"), _
      Iup::SetAttributes(Iup::Button(), "IMAGE=img1"), _
      Iup::SetAttributes(Iup::Button(), "IMAGE=img1,IMPRESS=img2")))
  Iup::SetAttribute(_frm_1,IUP_TITLE,"IupButton")

  _frm_2 = Iup::Frame( _
    Iup::Vbox( _
      Iup::Label("Label Text"), _
      Iup::SetAttributes(Iup::Label(""), "SEPARATOR=HORIZONTAL"), _
      Iup::SetAttributes(Iup::Label(""), "IMAGE=img1")))
  Iup::SetAttribute(_frm_2,IUP_TITLE,"IupLabel")

  _frm_3 = Iup::Frame( _
    Iup::Vbox( _
      Iup::SetAttributes(Iup::Toggle("Toggle Text"), "VALUE=ON"), _
      Iup::SetAttributes(Iup::Toggle(""), "IMAGE=img1,IMPRESS=img2"), _
      Iup::SetAttributes(Iup::Frame(Iup::Radio(Iup::Vbox( _
        Iup::Toggle("Toggle Text"), _
        Iup::Toggle("Toggle Text")))), "TITLE=IupRadio")))
  Iup::SetAttribute(_frm_3,IUP_TITLE,"IupToggle")

  _text_1 = Iup::Text()
  Iup::SetAttribute(_text_1,IUP_VALUE,"IupText Text")
  Iup::SetAttribute(_text_1,IUP_SIZE,"80x")

  _ml_1 = Iup::MultiLine()
  Iup::SetAttribute(_ml_1,IUP_VALUE,"IupMultiline Text\nSecond Line\nThird Line")
  Iup::SetAttribute(_ml_1,IUP_EXPAND,"YES")
  Iup::SetAttribute(_ml_1,IUP_SIZE,"80x60")

  _frm_4 = Iup::Frame(Iup::Vbox( _
    _text_1, _
    _ml_1))
  Iup::SetAttribute(_frm_4,IUP_TITLE,"IupText/IupMultiline")

  _list_1 = Iup::List()
  Iup::SetAttribute(_list_1,IUP_EXPAND,"YES")
  Iup::SetAttribute(_list_1,IUP_VALUE,"1")
  Iup::SetAttribute(_list_1,"1","Item 1 Text")
  Iup::SetAttribute(_list_1,"2","Item 2 Text")
  Iup::SetAttribute(_list_1,"3","Item 3 Text")

  _list_2 = Iup::List()
  Iup::SetAttribute(_list_2,IUP_DROPDOWN,"YES")
  Iup::SetAttribute(_list_2,IUP_EXPAND,"YES")
  Iup::SetAttribute(_list_2,IUP_VALUE,"2")
  Iup::SetAttribute(_list_2,"1","Item 1 Text")
  Iup::SetAttribute(_list_2,"2","Item 2 Text")
  Iup::SetAttribute(_list_2,"3","Item 3 Text")

  _list_3 = Iup::List()
  Iup::SetAttribute(_list_3,"EDITBOX","YES")
  Iup::SetAttribute(_list_3,IUP_EXPAND,"YES")
  Iup::SetAttribute(_list_3,IUP_VALUE,"3")
  Iup::SetAttribute(_list_3,"1","Item 1 Text")
  Iup::SetAttribute(_list_3,"2","Item 2 Text")
  Iup::SetAttribute(_list_3,"3","Item 3 Text")

  _frm_5 =  Iup::Frame(Iup::Vbox( _
      _list_1, _
      _list_2, _
      _list_3))
  Iup::SetAttribute(_frm_5,IUP_TITLE,"IupList")

  _hbox_1 = Iup::Hbox( _
    _frm_1, _
    _frm_2, _
    _frm_3, _
    _frm_4, _
    _frm_5)

  _cnv_1 = Iup::Canvas()
  Iup::SetAttribute(_cnv_1,IUP_POSX,"0.0")
  Iup::SetAttribute(_cnv_1,IUP_POSY,"0.0")
  Iup::SetAttribute(_cnv_1,IUP_BGCOLOR,"128 255 0")

  _vbox_1 = Iup::Vbox( _
    _hbox_1, _
    _cnv_1)
  Iup::SetAttribute(_vbox_1,IUP_MARGIN,"5x5")
  Iup::SetAttribute(_vbox_1,IUP_ALIGNMENT,"ARIGHT")
  Iup::SetAttribute(_vbox_1,IUP_GAP,"5")

  dlg = Iup::Dialog(_vbox_1)
  Iup::SetHandle("dlg",dlg)
  Iup::SetAttribute(dlg,IUP_MENU,"mnu")
  Iup::SetAttribute(dlg,IUP_TITLE,"IupDialog Title")

END SUB

' MAIN

  Iup::Open()
  init_dialog()
  Iup::Show(Iup::GetHandle("dlg"))
  Iup::MainLoop()
  Iup::Close()
 
  END


* sample.png (38.58 KB, 675x340 - viewed 34 times.)

* sample_win.png (16.41 KB, 531x325 - viewed 31 times.)
Logged
support
Administrator
*****
Posts: 409


« Reply #33 on: January 14, 2012, 03:17:50 PM »

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



Logged
support
Administrator
*****
Posts: 409


« Reply #34 on: January 17, 2012, 04:18:07 PM »

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





« Last Edit: January 17, 2012, 05:46:57 PM by support » Logged
support
Administrator
*****
Posts: 409


« Reply #35 on: January 17, 2012, 06:43:30 PM »

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


Logged
support
Administrator
*****
Posts: 409


« Reply #36 on: January 18, 2012, 08:43:49 PM »

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.

 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.

* iup_linux64-b10.tar.gz (446.74 KB - downloaded 15 times.)
* iup_linux32-b10.tar.gz (391.84 KB - downloaded 19 times.)
« Last Edit: January 18, 2012, 10:00:03 PM by support » Logged
RONB
Newbie
*
Posts: 35


« Reply #37 on: January 19, 2012, 02:15:29 AM »

Fantastic addition to scriptbasic, the cd graphics is exciting. Looking forward to trying it out.
Logged
support
Administrator
*****
Posts: 409


« Reply #38 on: January 19, 2012, 12:08:53 PM »

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.

 
Logged
support
Administrator
*****
Posts: 409


« Reply #39 on: January 26, 2012, 11:19:38 PM »

ScriptBasic does graphics! Here is a quick test of the CD (Canvas Draw) API in action.

Code:
IMPORT iup.bas

Iup::Open()

ican = Iup::Canvas()
Iup::SetAttribute(ican, "RASTERSIZE", "800x600")
Iup::SetAttribute(ican, "BORDER", "NO")

dlg = Iup::Dialog(Iup::Vbox(ican))
Iup::SetAttribute(dlg, "TITLE", "Mandelbrot Set")

Iup::Map(dlg)

ccan = CD::CreateCanvas(CD::ContextIup(), ican)

Iup::Show(dlg)

przelx = 3 / 800
przely = 2 / 600

FOR x = 1 TO 800
  FOR y = 1 TO 600
    a = 0
    b = 0
    c = 0
    x2 = (przelx * x) - 2
    y2 = (przely * y) - 1
    petla:
    a2 = a * a - b * b
    b2 = 2 * a * b
    a = a2 + x2
    b = b2 + y2
    z = a * a + b * b
    IF z < 4 AND c < 255 THEN
      c = c + 1
      GOTO petla
    END IF
    IF c = 255 THEN
      pixclr = CD::EncodeColor(0, 0, 0)
    ELSE
      g = 255 - c
      pixclr = CD::EncodeColor(g, g, g)
      ' Color version
      ' pixclr = (g+64) * g * (g+16)
    END IF
    CD::CanvasPixel(ccan, x, y, pixclr)
  NEXT y
NEXT x

Iup::MainLoop()
Iup::Close()
END



* mbs_frac.png (108.2 KB, 808x628 - viewed 24 times.)

* mandelbrot_set.png (83.22 KB, 808x628 - viewed 29 times.)
« Last Edit: February 01, 2012, 03:50:56 PM by support » Logged
RONB
Newbie
*
Posts: 35


« Reply #40 on: January 27, 2012, 01:49:53 AM »

Looks great. The last build I can find for windows is 9. Guess the next build 10 will run the Mandelbrot set example. The build 10 for Ubuntu Linux I cannot try as I am not running graphics desktop, just the command line server install. Think I might try to fit in a minimal x10 graphics install so I can try it with Linux. It will be fun to work with images with scriptbasic.
Logged
support
Administrator
*****
Posts: 409


« Reply #41 on: January 27, 2012, 11:45:57 AM »

I hope to get BUILD 11 out this weekend for Linux (32/64) and Windows 32.

You could create a VirtualBox on your Windows PC and run Ubuntu 32 in it for testing and experimentation. Ubuntu has a dual boot option that uses a portion of your NTFS Windows file system so you don't need to partition your disk. If your PC is new enough and can boot off a USB drive, that is another great way to run Linux as a secondary OS.

Logged
RONB
Newbie
*
Posts: 35


« Reply #42 on: January 29, 2012, 12:28:24 AM »

I installed virtualbox on my windows-xp computer, then installed ubuntu. Next I installed scriptbasic scriba-cv2.1.1_i386.deb and tried a few programs, all ok. Then installed iup.bas and iup.so build 10 linux. All the iup examples ran ok until the last graphics example. Got and error with it.
(scriba:1815): GTK-WARNING **: Unable to locate theme engine in module_path: "pixmap",
Looks very promising, Ron
Logged
support
Administrator
*****
Posts: 409


« Reply #43 on: January 29, 2012, 10:07:13 AM »

The graphics will be available in build 11. The build 10 release just enabled additional controls. (matrix, dial, color select, ...)

It won't be long. The CD API is pretty extensive and wrapping / testing it takes time.

To find out what IUP functions are enabled in the SB IUP extension module, look at the iup.bas include file.

I hope to get a SB version of the IUP docs on the SB wiki when I finish the interface code.
« Last Edit: January 29, 2012, 05:59:23 PM by support » Logged
RONB
Newbie
*
Posts: 35


« Reply #44 on: February 21, 2012, 01:42:30 AM »

I was wondering how build 11 is coming along. Looking forward to the graphics part of the IUP. Hope you have not  hit a snag with IUP.
Logged
Pages: 1 2 [3] 4
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!