Author Topic: IUP Linux and Windows  (Read 106434 times)

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows - Build 6
« Reply #15 on: December 31, 2011, 03:57:17 PM »
BUILD 6

As promised, here are the list functions returned in a ScriptBasic array. (see previous post)

Iup::GetAllAttributes
Iup::GetAllClasses
Iup::GetClassAttributes
Iup::GetClassCallbacks
Iup::GetAllNames
Iup::GetAllDialogs

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #16 on: January 02, 2012, 02:37:07 PM »
Who will be the first one (other than me) to post an example of IUP working with ScriptBasic on either Windows or Linux?

Based on the number of downloads and views of this thread, I'm willing to bet someone gave it a try.

If you're not a member of the forum, (what are you waiting for?) send me your code to post. (support@scriptbasic.org)

« Last Edit: January 02, 2012, 05:57:18 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #17 on: January 03, 2012, 06:19:05 PM »
One of my goals with the ScriptBasic IUP binding was to be able to use to output of the IUP dialog layout tool (see attached) to generate screen code I could use. Currently the dialog layout tool only generates C, Lua and LED source code. The  C output was close enough that with a few tweaks, I could get it to run in SB.

Original C output
Code: [Select]
/*   Generated by IupLayoutDialog export to C.   */

#include <stdlib.h>
#include <iup.h>

Ihandle* create_dialog_iupdict2(void)
{
  Ihandle* containers[10];

  containers[4] = IupSetAtt(NULL, IupCreatep("hbox",
      IupSetAtt(NULL, IupCreate("list"),
        "EXPAND", "HORIZONTAL",
        "SIZE", "120x",
        "VALUE", "1",
        "DROPDOWN", "YES",
        NULL),
      IupSetAtt(NULL, IupCreate("button"),
        "SIZE", "50x",
        "TITLE", "Fetch",
        NULL),
      NULL),
    "GAP", "5",
    NULL);

  containers[3] = IupSetAtt(NULL, IupCreatep("frame",
      containers[4],
      NULL),
    "TITLE", "Servers",
    NULL);

  containers[6] = IupSetAtt(NULL, IupCreatep("hbox",
      IupSetAtt(NULL, IupCreate("button"),
        "SIZE", "50x",
        "TITLE", "About",
        NULL),
      IupSetAtt(NULL, IupCreate("button"),
        "SIZE", "50x",
        "TITLE", "Clear",
        NULL),
      IupSetAtt(NULL, IupCreate("button"),
        "SIZE", "50x",
        "TITLE", "Exit",
        NULL),
      NULL),
    "GAP", "5",
    NULL);

  containers[5] = IupSetAtt(NULL, IupCreatep("frame",
      containers[6],
      NULL),
    "TITLE", "Controls",
    NULL);

  containers[2] = IupSetAtt(NULL, IupCreatep("hbox",
      containers[3],
      containers[5],
      NULL),
    "GAP", "10",
    NULL);

  containers[7] = IupSetAtt(NULL, IupCreatep("frame",
      IupSetAtt(NULL, IupCreate("list"),
        "EXPAND", "YES",
        "VISIBLELINES", "1",
        NULL),
      NULL),
    "TITLE", "Dictionaries",
    NULL);

  containers[8] = IupSetAtt(NULL, IupCreatep("frame",
      IupSetAtt(NULL, IupCreate("text"),
        "EXPAND", "YES",
        "MULTILINE", "YES",
        NULL),
      NULL),
    "TITLE", "Translation",
    NULL);

  containers[9] = IupSetAtt(NULL, IupCreatep("hbox",
      IupSetAtt(NULL, IupCreate("label"),
        "SIZE", "x12",
        "TITLE", "Enter Word to Search For:",
        NULL),
      IupSetAtt(NULL, IupCreate("text"),
        "EXPAND", "HORIZONTAL",
        NULL),
      IupSetAtt(NULL, IupCreate("button"),
        "SIZE", "50x",
        "TITLE", "Search",
        NULL),
      IupSetAtt(NULL, IupCreate("toggle"),
        "SIZE", "x12",
        "TITLE", "ALL",
        NULL),
      IupSetAtt(NULL, IupCreate("toggle"),
        "SIZE", "x12",
        "TITLE", "UTF-8",
        NULL),
      NULL),
    "GAP", "10",
    NULL);

  containers[1] = IupSetAtt(NULL, IupCreatep("vbox",
      containers[2],
      containers[7],
      containers[8],
      containers[9],
      NULL),
    "MARGIN", "10x10",
    NULL);

  containers[0] = IupSetAtt(NULL, IupCreatep("dialog",
      containers[1],
      NULL),
    "TITLE", "Thesaurus",
    "RASTERSIZE", "875x638",
    NULL);

  return containers[0];
}

Converted to ScriptBasic
Code: [Select]
IMPORT iup.bas

Iup::Open()

  containers[4] = Iup::SetAtt("", Iup::Createp("hbox", _
      Iup::SetAtt("", Iup::Create("list"), _
        "EXPAND", "HORIZONTAL", _
        "SIZE", "120x", _
        "VALUE", "1", _
        "DROPDOWN", "YES"), _
      Iup::SetAtt("", Iup::Create("button"), _
        "SIZE", "50x", _
        "TITLE", "Fetch")), _
    "GAP", "5")

  containers[3] = Iup::SetAtt("", Iup::Createp("frame", _
      containers[4]), _
    "TITLE", "Servers")

  containers[6] = Iup::SetAtt("", Iup::Createp("hbox", _
      Iup::SetAtt("", Iup::Create("button"), _
        "SIZE", "50x", _
        "TITLE", "About"), _
      Iup::SetAtt("", Iup::Create("button"), _
        "SIZE", "50x", _
        "TITLE", "Clear"), _
      Iup::SetAtt("", Iup::Create("button"), _
        "SIZE", "50x", _
        "TITLE", "Exit")), _
    "GAP", "5")

  containers[5] = Iup::SetAtt("", Iup::Createp("frame", _
      containers[6]), _
    "TITLE", "Controls")

  containers[2] = Iup::SetAtt("", Iup::Createp("hbox", _
      containers[3], _
      containers[5]), _
    "GAP", "10")

  containers[7] = Iup::SetAtt("", Iup::Createp("frame", _
      Iup::SetAtt("", Iup::Create("list"), _
        "EXPAND", "YES", _
        "VISIBLELINES", "1")), _
    "TITLE", "Dictionaries")

  containers[8] = Iup::SetAtt("", Iup::Createp("frame", _
      Iup::SetAtt("", Iup::Create("text"), _
        "EXPAND", "YES", _
        "MULTILINE", "YES")), _
    "TITLE", "Translation")

  containers[9] = Iup::SetAtt("", Iup::Createp("hbox", _
      Iup::SetAtt("", Iup::Create("label"), _
        "SIZE", "x12", _
        "TITLE", "Enter Word to Search For:"), _
      Iup::SetAtt("", Iup::Create("text"), _
        "EXPAND", "HORIZONTAL"), _
      Iup::SetAtt("", Iup::Create("button"), _
        "SIZE", "50x", _
        "TITLE", "Search"), _
      Iup::SetAtt("", Iup::Create("toggle"), _
        "SIZE", "x12", _
        "TITLE", "ALL"), _
      Iup::SetAtt("", Iup::Create("toggle"), _
        "SIZE", "x12", _
        "TITLE", "UTF-8")), _
    "GAP", "10")

  containers[1] = Iup::SetAtt("", Iup::Createp("vbox", _
      containers[2], _
      containers[7], _
      containers[8], _
      containers[9]), _
    "MARGIN", "10x10")

  containers[0] = Iup::SetAtt("", Iup::Createp("dialog", _
      containers[1]), _
    "TITLE", "Thesaurus", _
    "RASTERSIZE", "875x638")
    Iup::SetCallback(containers[0],"CLOSE_CB",ADDRESS(Win_exit()))

Iup::Show(containers[0])

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

SUB Win_exit
  Iup::ExitLoop = TRUE
END SUB
« Last Edit: January 03, 2012, 06:26:09 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #18 on: January 04, 2012, 12:53:59 PM »
I'm in the process of converting the C examples on the IUP project site.

C Version


ScriptBasic Version
Code: [Select]
' Iup Alarm: Example in SB
' Shows a dialog similar to the one shown when you exit a program without saving.

IMPORT iup.bas

' Initializes IUP
  Iup::Open()

' Executes IupAlarm
  response = Iup::Alarm ("IupAlarm Example", "File not saved! Save it now?", "Yes", "No", "Cancel")

' Shows a message for each selected button
  IF response = 1 THEN Iup::Message ("Save file", "File saved successfully - leaving program")
  IF response = 2 THEN Iup::Message ("Save file", "File not saved - leaving program anyway")
  IF response = 3 THEN Iup::Message ("Save file", "Operation canceled")
 
' Finishes IUP
  Iup::Close()

' Program finished successfully
  END







« Last Edit: January 04, 2012, 01:24:29 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
IUP Linux and Windows - Build 7
« Reply #19 on: January 04, 2012, 05:15:33 PM »
BUILD 7

  • Iup::SetAtt - now supports multiple attribute pairs and setting the handle name if provided.
  • Iup::Createp - now supports appending children to containers.


So far I have been able to eliminate NULL as a argument to terminate parameter lists. With optional parameter support and knowing how many arguments were passed to the interface module, (SB API) the need for a NULL argument as a list terminator dissipated.

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #20 on: January 06, 2012, 10:41:46 PM »
Here is the button.c example converted to ScriptBasic.

C Version

Code: [Select]
'"""**************************************************************************
 *                             IupButton example                             *
 *   Description : Creates four buttons. The first uses images, the second   *
 *                 turns the first on and off, the third exits the           *
 *                 application and the last does nothing                     *
 **************************************************************************"""

IMPORT iup.bas

' Defines released button's image
pixmap_release = """
       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,4,4,3,3,3,3,2,2,
       1,1,3,3,3,3,3,4,4,4,4,3,3,3,2,2,
       1,1,3,3,3,3,3,4,4,4,4,3,3,3,2,2,
       1,1,3,3,3,3,3,3,4,4,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
       2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
"""

' Defines pressed button's image
pixmap_press = """
       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,4,4,3,3,3,3,3,2,2,
       1,1,3,3,3,3,4,4,4,4,3,3,3,3,2,2,
       1,1,3,3,3,3,4,4,4,4,3,3,3,3,2,2,
       1,1,3,3,3,3,3,4,4,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
       2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
"""

' Defines inactive button's image
pixmap_inactive = """
       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,4,4,3,3,3,3,2,2,
       1,1,3,3,3,3,3,4,4,4,4,3,3,3,2,2,
       1,1,3,3,3,3,3,4,4,4,4,3,3,3,2,2,
       1,1,3,3,3,3,3,3,4,4,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,1,3,3,3,3,3,3,3,3,3,3,3,3,2,2,
       1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
       2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
"""

GLOBAL CONST IUP_BUTTON1 = "1"
GLOBAL CONST IUP_CENTER = 65535


'"""***************************************************************************
 * Function:                                                                  *
 * On off button callback                                                     *
 *                                                                            *
 * Description:                                                               *
 * Callback called when the on/off button is activated. Turns the button with *
 * image on and off                                                           *
 *                                                                            *
 * Parameters received:                                                       *
 * self - element identifier                                                  *
 *                                                                            *
 * Value returned:                                                            *
 * IUP_DEFAULT                                                                *
 ***************************************************************************"""
SUB btn_on_off_cb

  ' Recovers "btn_image" handle
  btn_image = Iup::GetHandle( "btn_image" )

  ' If the button with with image is active...
  IF Iup::GetAttribute( btn_image, "ACTIVE" ) = "YES" THEN

    ' Deactivates the button with image
    Iup::SetAttribute( btn_image, "ACTIVE","NO" )

  ' else it is inactive
  ELSE
    ' Activates the button with image
    Iup::SetAttribute( btn_image, "ACTIVE", "YES" )
  END IF

  ' Executed function successfully
END SUB


'"""***************************************************************************
 * Function:                                                                  *
 * Button with image button callback                                          *
 *                                                                            *
 * Description:                                                               *
 * Callback called when the image button is pressed or released. Shows a      *
 * message saying if the button was pressed or released                       *
 *                                                                            *
 * Parameters received:                                                       *
 * self - identifies the canvas that activated the function’s execution.      *
 * b    - identifies the activated mouse button:                              *
 *                                                                            *
 * IUP_BUTTON1 left mouse button (button 1)                                   *
 * IUP_BUTTON2 middle mouse button (button 2)                                 *
 * IUP_BUTTON3 right mouse button (button 3)                                  *
 *                                                                            *
 * e     - indicates the state of the button:                                 *
 *                                                                            *
 * 0 mouse button was released                                                *
 * 1 mouse button was pressed                                                 *
 *                                                                            *
 * Value returned:                                                            *
 * IUP_DEFAULT                                                                *
 ***************************************************************************"""
SUB btn_image_button_cb

  ' If the left button changed its state...
  IF CHR(Iup::GetBtnPressed()) = IUP_BUTTON1 THEN

    ' Recovers "text" handle
    text = Iup::GetHandle( "text" )

    ' If the button was pressed...
    IF Iup::GetBtnState() = 1 THEN

      ' Sets text's value
      Iup::SetAttribute( text, "VALUE", "Red button pressed" )

    ' else the button was released
    ELSE

      ' Sets text's value
      Iup::SetAttribute( text, "VALUE", "Red button released" )
    END IF
  END IF

' Executed function successfully
END SUB


'"""***************************************************************************
 * Function:                                                                  *
 * Exit button callback                                                       *
 *                                                                            *
 * Description:                                                               *
 * Callback called when exit button is activated. Exits the program           *
 *                                                                            *
 * Parameters received:                                                       *
 * self - element identifier                                                  *
 *                                                                            *
 * Value returned:                                                            *
 * IUP_DEFAULT                                                                *
 ***************************************************************************"""
SUB btn_exit_cb

  ' Exits the program
  Iup::ExitLoop = TRUE

END SUB

'"""***************************************************************************
 * Main function                                                              *
 ***************************************************************************"""

  ' Initializes IUP
  Iup::Open()

  ' Creates a text
  text = Iup::Text()
  Iup::SetAttribute(text,"SIZE","100x")

  ' Turns on read-only mode
  Iup::SetAttribute( text, "READONLY", "YES")

  ' Associates text with handle "text"
  Iup::SetHandle ( "text", text )

  ' Defines released button's image size
  img_release = Iup::Image(16, 16, Iup::CreateImg(pixmap_release))

  ' Defines released button's image colors
  Iup::SetAttribute( img_release, "1", "215 215 215" )
  Iup::SetAttribute( img_release, "2", "40 40 40" )
  Iup::SetAttribute( img_release, "3", "30 50 210" )
  Iup::SetAttribute( img_release, "4", "240 0 0" )

  ' Associates img_release with handle "img_release"
  Iup::SetHandle( "img_release", img_release)

  ' Defines pressed button's image size
  img_press = Iup::Image( 16, 16, Iup::CreateImg(pixmap_press))

  ' Defines pressed button's image colors
  Iup::SetAttribute( img_press, "1", "40 40 40" )
  Iup::SetAttribute( img_press, "2", "215 215 215" )
  Iup::SetAttribute( img_press, "3", "0 20 180" )
  Iup::SetAttribute( img_press, "4", "210 0 0" )

  ' Associates img_press with handle "img_press"
  Iup::SetHandle ( "img_press", img_press )

  ' Defines inactive button's image size
  img_inactive = Iup::Image( 16, 16, Iup::CreateImg(pixmap_inactive))

  ' Defines inactive button's image colors
  Iup::SetAttribute( img_inactive, "1", "215 215 215" )
  Iup::SetAttribute( img_inactive, "2", "40 40 40" )
  Iup::SetAttribute( img_inactive, "3", "100 100 100" )
  Iup::SetAttribute( img_inactive, "4", "200 200 200" )

  ' Associates img_inactive with handle "img_inactive"
  Iup::SetHandle ("img_inactive", img_inactive )

  ' Creates a button
  btn_image = Iup::Button( "Button with image", "btn_image")

  ' Sets released, pressed and inactive button images
  Iup::SetAttribute( btn_image, "IMAGE", "img_release" )
  Iup::SetAttribute( btn_image, "IMPRESS", "img_press" )
  Iup::SetAttribute( btn_image, "IMINACTIVE", "img_inactive" )

  ' Associates button callback with action bti_button_act
  Iup::SetAttribute( btn_image, "BUTTON_CB", "btn_image_button")

  ' Associates btn_image with handle "btn_image"
  Iup::SetHandle( "btn_image", btn_image )

  ' Creates a button
  btn_big = Iup::Button( "Big useless button" )

  ' Sets big button size
  Iup::SetAttribute( btn_big, "SIZE", "EIGHTHxEIGHTH" )

  ' Creates a button entitled Exit associated with action exit_act
  btn_exit = Iup::Button( "Exit", "btn_exit")

  ' Creates a button entitled on/off associated with action onoff_act
  btn_on_off = Iup::Button( "on/off", "btn_on_off")

  ' Creates dialog with the four buttons and the text
  dlg = Iup::Dialog _
        ( _
          Iup::Vbox _
          ( _
            Iup::Hbox _
            ( _
              btn_image, _
              btn_on_off, _
              btn_exit), _
            text, _
            btn_big))


  ' Sets dialogs title to IupButton turns resize, maximize, minimize and menubox off
  Iup::SetAttributes( dlg, "EXPAND = YES, TITLE = IupButton, RESIZE = YES" )
  Iup::SetAttributes( dlg, "MENUBOX = NO, MAXBOX = NO, MINBOX = NO" )

  ' Registers callbacks
  Iup::SetCallback( btn_exit, "ACTION", ADDRESS( btn_exit_cb() ))
  Iup::SetCallback( btn_on_off, "ACTION", ADDRESS( btn_on_off_cb() ))
  Iup::SetCallback( btn_image, "BUTTON_CB", ADDRESS( btn_image_button_cb() ))

  ' Shows dialog on the center of the screen
  Iup::ShowXY( dlg, IUP_CENTER, IUP_CENTER )


  ' Initializes IUP main loop
  Iup::MainLoop()

  ' Finishes IUP
  Iup::Close()

' Program finished successfully
END

« Last Edit: January 07, 2012, 01:28:37 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #21 on: January 07, 2012, 01:27:45 PM »
Here is the filedlg.c example in ScriptBasic.

C Version

Code: [Select]
' IupFileDlg Example in ScriptBasic
' Shows a typical file-saving dialog.

IMPORT iup.bas

GLOBAL CONST IUP_CENTER = 0xFFFF

Iup::Open()
Iup::SetLanguage("ENGLISH")

filedlg = Iup::FileDlg()

Iup::SetAttributes(filedlg, "DIALOGTYPE = SAVE, TITLE = \"File Save\"")
Iup::SetAttributes(filedlg, "FILTER = \"*.sb\", FILTERINFO = \"ScriptBasic Files\"")

Iup::Popup(filedlg, IUP_CENTER, IUP_CENTER)

response = Iup::GetInt(filedlg, "STATUS")
IF response = 1 THEN Iup::Message("New file",Iup::GetAttribute(filedlg, "VALUE"))
IF response = 0 THEN Iup::Message("File already exists",Iup::GetAttribute(filedlg, "VALUE"))
IF response = -1 THEN Iup::Message("IupFileDlg","Operation Canceled")

Iup::Destroy(filedlg)
Iup::Close()
END

« Last Edit: January 07, 2012, 01:35:06 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #22 on: January 07, 2012, 04:35:10 PM »
Icon, menu and a cursor change to show with this dialog1.c example.

C Version

Code: [Select]
' IupDialog: Example in ScriptBasic
' Creates a dialog showing an icon, the "DEFAULTESC" attribute and a simple menu

IMPORT iup.bas

GLOBAL CONST IUP_CENTER = 0xFFFF

' defines icon's image
img = """
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,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,5,5,4,2,
1,3,5,5,5,5,6,6,5,5,5,5,6,6,5,5,6,6,5,5,6,6,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,6,6,6,6,6,6,5,5,6,6,6,6,6,6,5,5,6,6,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,6,6,6,6,6,6,5,5,5,6,6,6,6,5,5,5,6,6,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,
1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
"""

SUB quit_cb
  Iup::ExitLoop = TRUE
END SUB

Iup::Open()

' Creating dialog's icon
icon = Iup::Image(32, 32, Iup::CreateImg(img))
Iup::SetAttribute(icon, "1", "255 255 255")
Iup::SetAttribute(icon, "2", "000 000 000")
Iup::SetAttribute(icon, "3", "226 226 226")
Iup::SetAttribute(icon, "4", "128 128 128")
Iup::SetAttribute(icon, "5", "192 192 192")
Iup::SetAttribute(icon, "6", "000 000 255")
Iup::SetHandle("icon", icon)

' Creating dialog's content
quit_bt = Iup::Button("Quit")
Iup::SetCallback(quit_bt, "ACTION", ADDRESS(quit_cb()))
Iup::SetHandle("quit", quit_bt)

' Creating dialog's menu
options = Iup::Menu(Iup::Item("Exit","quit_cb"))
submenu = Iup::Submenu("File", options)
menu = Iup::Menu(submenu)
Iup::SetHandle("menu", menu)

' Creating main dialog
dialog = Iup::Dialog(Iup::Vbox(quit_bt))
Iup::SetAttribute(dialog, "TITLE", "IupDialog")
Iup::SetAttribute(dialog, "MENU", "menu")
Iup::SetAttribute(dialog, "CURSOR", "CROSS")
Iup::SetAttribute(dialog, "ICON", "icon")
Iup::SetAttribute(dialog, "DEFAULTESC", "quit")

Iup::ShowXY(dialog, IUP_CENTER, IUP_CENTER)
Iup::MainLoop()
Iup::Close()
END

« Last Edit: January 07, 2012, 09:00:15 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
IUP Linux and Windows - Build 8
« Reply #23 on: January 07, 2012, 05:57:24 PM »
BUILD 8

This fixes a couple things with Iup::Image and a fix to integers in the argument passing macro. (thanks Armando)






Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
IUP Linux and Windows - Build 9
« Reply #24 on: January 09, 2012, 06:26:27 PM »
BUILD 9

This release allows assigning multiple callback functions to a single control.

Sure would be nice to hear some feedback from others that have given the ScriptBasic IUP environment a try.

I don't see the point of adding the extended IUP API (OpenGL, Matrix, Drawing, Embedded Browser, ...) binding to the project if no one is going to use the core IUP features.

This will be the last release of the core IUP extension module unless someone finds a problem with it.

Enjoy!


« Last Edit: January 09, 2012, 06:28:55 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #25 on: January 09, 2012, 10:14:14 PM »
Here is the submenu.c example converted to ScriptBasic. It's too bad I can't show the multi-level menu in a screen capture.

C Version

ScriptBasic Version
Code: [Select]
' IupSubmenu: Example in ScriptBasic
' Creates a dialog with a menu with three submenus.
' One of the submenus has a submenu, which has another submenu.

IMPORT iup.bas

GLOBAL CONST IUP_CENTER = 0xFFFF

'"""***************************************************************************
 * Function:                                                                  *
 * Item help callback                                                         *
 *                                                                            *
 * Description:                                                               *
 * Shows a message saying that only Help and Exit items performs an operation *
 *                                                                            *
 * Value returned:                                                            *
 * IUP_DEFAULT                                                                *
 ***************************************************************************"""
SUB item_help_cb

  Iup::Message ("Warning", "Only Help and Exit items performs an operation")

END SUB  

'"""***************************************************************************
 * Function:                                                                  *
 * Item exit callback                                                         *
 *                                                                            *
 * Description:                                                               *
 * Exits the program                                                          *
 *                                                                            *
 * Value returned:                                                            *
 * IUP_DEFAULT                                                                *
 ***************************************************************************"""
SUB item_exit_cb

  Iup::ExitLoop = TRUE

END SUB

' Main program
  
' Initializes IUP
Iup::Open()

' Program begin
  
' Creates a multiline
text = Iup::Text()
  
' Sets value of the text and turns on expand
Iup::SetAttributes(text, "VALUE = \"This text is here only to compose\", EXPAND = YES")
    
' Creates items of menu file
item_new = Iup::Item("New")
item_open = Iup::Item("Open")
item_close = Iup::Item("Close")
item_exit = Iup::Item("Exit", "item_exit_act")

' Creates items of menu edit
item_copy = Iup::Item("Copy")
item_paste = Iup::Item("Paste")

' Creates items for menu triangle
item_scalenus = Iup::Item("Scalenus")
item_isoceles = Iup::Item("Isoceles")
item_equilateral = Iup::Item("Equilateral")

' Create menu triangle
menu_triangle = Iup::Menu(item_equilateral, item_isoceles, item_scalenus)

' Creates submenu triangle
submenu_triangle = Iup::Submenu("Triangle", menu_triangle)

' Creates items for menu create
item_line = Iup::Item("Line")
item_circle = Iup::Item("Circle")

' Creates menu create
menu_create = Iup::Menu(item_line, item_circle, submenu_triangle)

' Creates submenu create
submenu_create = Iup::Submenu("Create", menu_create)

' Creates items of menu help
item_help = Iup::Item("Help", "item_help_act")
  
' Creates three menus
menu_file = Iup::Menu(item_new, item_open, item_close, Iup::Separator(), item_exit)
menu_edit = Iup::Menu(item_copy, item_paste, Iup::Separator(), submenu_create)
menu_help = Iup::Menu(item_help)

' Creates three submenus
submenu_file = Iup::Submenu("File", menu_file)
submenu_edit = Iup::Submenu("Edit", menu_edit)
submenu_help = Iup::Submenu("Help", menu_help)
  
' Creates main menu with file menu
menu = Iup::Menu(submenu_file, submenu_edit, submenu_help)

' Registers callbacks
Iup::SetCallback(item_help, "ACTION", ADDRESS(item_help_cb()))
Iup::SetCallback(item_exit, "ACTION", ADDRESS(item_exit_cb()))
 
' Associates handle "menu" with menu
Iup::SetHandle("menu", menu)
                                
' Creates dialog with a text
dlg = Iup::Dialog(text)

' Sets title and size of the dialog and associates a menu to it
Iup::SetAttributes(dlg, "TITLE=\"IupSubmenu Example\", SIZE = QUARTERxEIGHTH, MENU = menu")

' Shows dialog in the center of the screen
Iup::ShowXY(dlg, IUP_CENTER, IUP_CENTER)

' Initializes IUP main loop
Iup::MainLoop()

' Finishes IUP
Iup::Close()  

' Program finished successfully
END
« Last Edit: January 09, 2012, 10:16:22 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #26 on: January 10, 2012, 08:56:29 AM »
Thanks Ron for giving SB/IUP a try. I don't have the 'DOS' box/console issue with Linux if I insert the #! /usr/bin/scriba as the first line of the script or compile the application to C. The CIO Windows extension module has a Detach() function to kill the DOS box and run your application as a GUI program. I'm looking at adding a new command line switch for scriba to disable the console on startup.

Thanks for the menu screen shots! I'm trying to convert the C examples on the IUP site to help get folks going with IUP.

Are you running Windows 2000? If your running XP or greater, you should be seeing the current themed windows and controls with the IUP interface.

« Last Edit: January 10, 2012, 11:42:43 AM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #27 on: January 10, 2012, 12: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, 02:34:18 PM by support »

Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #28 on: January 10, 2012, 04: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.


Support

  • Administrator
  • *****
  • Posts: 19
    • View Profile
Re: IUP Linux and Windows
« Reply #29 on: January 13, 2012, 07:52:59 PM »
Here is the IUP sample.c converted to ScriptBasic.

C Version

Code: [Select]
' 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,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,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,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,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,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,2,2,1,1,1,1,1,1,1
,1,1,1,1,1,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,3,3,3,3,3,3,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
,2,2,2,2,2,2,2,3,3,3,3,3,3,3,1,1,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2
,2,2,2,2,2,2,3,3,3,3,3,3,3,3,1,1,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2
,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2
,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2
,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
"""

SUB init_dialog

  img = Iup::Image(32,32, Iup::CreateImg(img_bits1))
  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