Author Topic: Script BASIC IUP / LED  (Read 3572 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Script BASIC IUP / LED
« on: August 07, 2018, 10:13:44 AM »
I putting on a full court press to utilize the IUP LED dialog definition framework. I will be releasing another Inno buld of Script BASIC with current IUP libraries and an extension SB module. / include. I would love to pick James Fuller's mind on his thoughts about LED and get access to the documentation he was able to gather.

This effort will also be available on Linux under Script BASIC.

I might try to use UPX on Windows to consolidate the IUP set of DLLs as a single resource.


Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: Script BASIC IUP / LED
« Reply #1 on: August 07, 2018, 03:13:55 PM »
Here is a Script BASIC LED example based on James Fuller's IUP efforts.

Code: ScriptBasic
  1. ' James Fuller IUP LED Example
  2.  
  3. LED = """
  4. # ==============================================================================
  5. #cardfile
  6. # ==============================================================================
  7. btn_prior = BUTTON[SIZE = 50x15, IMAGE=IUP_ArrowLeft]("",NULL)
  8. btn_next =  BUTTON[SIZE = 50x15, IMAGE=IUP_ArrowRight]("",NULL)
  9. btn_find =   BUTTON[SIZE = 50x15, IMAGE=IUP_EditFind]("",NULL)
  10. btn_add  =   BUTTON[SIZE = 50x15, IMAGE=IUP_FileSave]("",NULL)
  11. btn_update =  BUTTON[SIZE = 50x15, IMAGE=IUP_NavigateRefresh]("",NULL)
  12. btn_delete =  BUTTON[SIZE = 50x15, IMAGE=IUP_EditErase]("",NULL)
  13. btn_print =  BUTTON[SIZE = 50x15, IMAGE=IUP_Print]("",NULL)
  14. btn_cancel = BUTTON[SIZE = 50x15, IMAGE=IUP_ActionCancel]("",NULL)
  15. # ==============================================================================
  16. id_index = LABEL[]("0 / 0")
  17. entry_company = TEXT[EXPAND = HORIZONTAL](NULL)
  18. entry_last = TEXT[EXPAND = HORIZONTAL](NULL)
  19. entry_first = TEXT[EXPAND = HORIZONTAL](NULL)
  20. entry_add1 = TEXT[EXPAND = HORIZONTAL](NULL)
  21. entry_add2 = TEXT[EXPAND = HORIZONTAL](NULL)
  22. entry_add3 = TEXT[EXPAND = HORIZONTAL](NULL)
  23. entry_city = TEXT[EXPAND = HORIZONTAL](NULL)
  24. entry_state = TEXT[SIZE = 120x](NULL)
  25. entry_zip = TEXT[SIZE = 80x](NULL)
  26. cbo_country = LIST[DROPDOWN=YES, SIZE=100x,VALUE=1](NULL)
  27. entry_phone = TEXT[SIZE=70x](NULL)
  28. entry_fax = TEXT[SIZE=70x](NULL)
  29. entry_email = TEXT[EXPAND = HORIZONTAL](NULL)
  30. entry_www = TEXT[EXPAND = HORIZONTAL](NULL)
  31. entry_comments = TEXT[MULTILINE=YES, EXPAND=YES](NULL)
  32. # ==============================================================================
  33. cardfile = DIALOG[TITLE = "Card File"]
  34. (
  35.    VBOX[MARGIN = 5x5]
  36.    (
  37.        HBOX[GAP = 5]
  38.        (
  39.            FILL(),
  40.            LABEL[TITLE = " Record No."](""),id_index
  41.        ),
  42.        FRAME[TITLE = Company]
  43.        (
  44.             entry_company
  45.        ),
  46.        HBOX[GAP = 5]
  47.        (
  48.            FRAME[TITLE = "Last Name"]
  49.            (
  50.                entry_last
  51.            ),
  52.            FRAME[TITLE = "First Name"]
  53.            (
  54.                entry_first
  55.            )
  56.        ),
  57.        FRAME[TITLE = "Address"]
  58.        (
  59.            VBOX[GAP = 5]
  60.            (
  61.                entry_add1,
  62.                entry_add2,
  63.                entry_add3
  64.            )
  65.        ),
  66.        HBOX[GAP = 5]
  67.        (
  68.            FRAME[TITLE = "City"]
  69.            (
  70.                entry_city
  71.            ),
  72.            FRAME[ TITLE = "State / Province"]
  73.            (
  74.                 entry_state
  75.            ),
  76.            FRAME[TITLE = "Zip or Postal Code"]
  77.            (
  78.                entry_zip
  79.            ),
  80.            FRAME[TITLE = "Country"]
  81.            (
  82.                 cbo_country
  83.            )
  84.        ),
  85.        HBOX[GAP = 5]
  86.        (
  87.            FRAME[TITLE = "Phone"]
  88.            (
  89.                entry_phone
  90.            ),
  91.            FRAME[TITLE = "Fax"]
  92.            (
  93.                entry_fax
  94.            ),
  95.            FRAME[TITLE = "Email"]
  96.            (
  97.                entry_email
  98.            ),
  99.            FRAME[TITLE = "www"]
  100.            (
  101.                entry_www
  102.            )
  103.        ),
  104.        FRAME[TITLE = "Comments"]
  105.        (
  106.            TEXT[EXPAND = YES,MULTILINE = YES,NAME = entry_comments](do_nothing)
  107.        ),
  108.        HBOX[GAP = 10]
  109.        (
  110.            FILL(),
  111.            btn_prior,btn_next,btn_find,btn_add,btn_update,btn_delete,btn_print,btn_cancel,
  112.            FILL()
  113.        )
  114.    )
  115. )
  116. """
  117.  
  118. SUB Win_exit
  119.   Iup::ExitLoop = TRUE
  120. END SUB
  121.  
  122. IMPORT iup.bas
  123.  
  124. Iup::Open
  125. Iup::ImageLibOpen
  126. Iup::SetGlobal("DEFAULTFONT", "Helvetica, 11")
  127. Iup::LoadBuffer(LED)
  128.  
  129. Iup::SetCallback(Iup::GetHandle("btn_cancel"), "ACTION", ADDRESS(Win_exit()))
  130.  
  131. Iup::Show(Iup::GetHandle("cardfile"))
  132.  
  133. Iup::MainLoop()
  134.  
  135. Iup::Close()
  136.  


Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: Script BASIC IUP / LED
« Reply #2 on: August 07, 2018, 06:25:21 PM »
IUP comes with a built-in dialog designer that lets you make changes to a running instance. It has a nice property display/edit feature and generates LED and C source code.
« Last Edit: August 07, 2018, 08:46:05 PM by John »

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: Script BASIC IUP / LED
« Reply #3 on: August 09, 2018, 09:43:02 PM »

I might try to use UPX on Windows to consolidate the IUP set of DLLs as a single resource.

Hi, John!

I don't think UPX will do this (combine files).  Even if it did, how would you call the dll functions?

Maybe if you took ALL of the object files and created a single massive dll and upx'd that it might work....

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: Script BASIC IUP / LED
« Reply #4 on: August 09, 2018, 10:25:25 PM »
Damn!

I thought it created a multi-resource self expanding archive.   :-[

I just put all the SB dependencies in the bin directory which gets included into the system path setting at install.

« Last Edit: August 10, 2018, 02:13:27 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: Script BASIC IUP / LED
« Reply #5 on: August 11, 2018, 09:55:15 PM »
I'm seriously looking at VB6 form OCX's as an alternative to IUP on Windows.

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: Script BASIC IUP / LED
« Reply #6 on: August 25, 2018, 08:35:12 PM »
@AIR,

I realized that IUP also offers static linking and GCC supports dead code removal.