Author Topic: IUP Resizing Example Please  (Read 9728 times)

Mike Lobanovsky

  • Guest
IUP Resizing Example Please
« on: April 26, 2014, 02:09:29 PM »
Hello John,

Can you recompile your latest IUP GUI resizing example for the GUI Makeover Contest to 32-bit Windows and upload the executable with its IUP dependency(-ies) here in a zip please?

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: IUP Resizing Example Please
« Reply #1 on: April 26, 2014, 02:33:42 PM »
Here is the Script BASIC IUP extension module version of the new_customer.sb program and all the dependencies. (sbiup.exe and scriba.exe as well) You still need to put the iup.dll from the distribution in your Windows system32 (XP) - SysWOW64 (64 bit Win).

Let me know if there is anything else you need.




Mike Lobanovsky

  • Guest
Re: IUP Resizing Example Please
« Reply #2 on: April 26, 2014, 05:57:15 PM »
I'm sorry to say, John, but I couldn't cope with the problem.

1. The IUP libraries downloadable from puc-rio are dependent on Cygwin. The minimum installation of Cygwin is another 100MB.

2. With Cygwin istalled, the IUP libraries still can't find Cygwin because it doesn't install itself into proper Windows system directories.

3. With Cygwin1.dll and iup.dll added to the C:\4Mike folder (that's one of Windows' native setups for all the dependencies to be resolved), sbiup new_customer.sb just hangs the sbiup.exe process in memory infinitely.

4. With all the Cygwin binaries and IUP libraries added to the C:\4Mike folder, sbiup.exe still hangs in the same way.

5. In the meantime, simple console tests like scriba hangman.sb run as expected.

All this happens in both native 32-bit XP and 64-bit 7's syswow64 modes.

Any idea as to why IUP/sbiup.exe might be inoperative? Resource utilities show that all inter-dependencies are resolved yet nothing happens.

P.S. Also, there seems to be a problem with include file import: IMPORT iup.bas can't find this file in the same directory with new_customer.sb. Changing it to an explicit IMPORT "C:\4Mike\iup.bas" (natural for Windows) seems to solve the problem (of import only - the sample still doesn't work but hangs as described above); at least SB doesn't show unresolved function references that otherwise flood the console.

Are double quotes a correct way to specify a full path to the include file at all (assuming there may be spaces present within the path names)?
« Last Edit: April 26, 2014, 06:22:09 PM by Mike Lobanovsky »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: IUP Resizing Example Please
« Reply #3 on: April 26, 2014, 06:13:06 PM »
I compiled the Window 32 bit version of Script BASIC 2.2 with VC10. (Windows 7 SDK C console compiler) I have attached the IUP DLLs (VC10 version) for you. If you would like the CD (Canvas Draw) set you can download them from Sourceforge (VC10 version) and you will have everything I have for IUP.

The iup.bas goes in your Script BASIC include directroy. The pui.dll goes in your Script BASIC modules directory. If the Script BASIC bin directory is in your search path then you can run the scripts from anywhere. I'm assuming you already created a SCRIBA.INI by compiling your Script BASIC configuration text file with a scriba -k scriba.conf.text? The config file must point to the include and modules directories (with a trailing \) at the minimum.

Here is what my Windows configuration file for Script BASIC looks like. The scriba -D will display this to the console or redirected it to a text file, edit it and recompile it again with the scriba -k config_from_-D_redirect

Code: [Select]
dll ".dll"
module "/SB22/modules/"
include "/SB22/include/"
maxinclude 100
preproc (
  internal (
    sdbg "/SB22/modules/sdbg.dll"
   )
 )
maxstep 0
maxlocalstep 0
maxlevel 3000
maxmem 0
servers (
  ip "127.0.0.1"
  port 8080
  threads 20
  listenbacklog 3
  proxyip 0
  home "../sbweb/"
  pid (
    file "../log/pid.txt"
    delay 10
    wait (
      period 10
      length 1
     )
   )
  errmsgdest 3
  nolog 0
  log (
    panic (
      file "../log/panic.log"
     )
    app (
      file "../log/app.log"
     )
    err (
      file "../log/err.log"
     )
    hit (
      file "../log/hit.log"
     )
    stat (
      file "../log/stat.log"
     )
   )
 )
[code]
« Last Edit: April 26, 2014, 06:28:31 PM by John »

Mike Lobanovsky

  • Guest
Re: IUP Resizing Example Please
« Reply #4 on: April 26, 2014, 06:34:53 PM »
This is why I requested you to compile this sample to an exe, e.g. like you did with hangman. With hangman.exe available, I don't have any headaches with SB installation at all. Or do you want me to have SB installed on every bit of HW I have? ;) I have only one installation of FBSL on my XP and I'm using executables to test my FBSL programs on everything else.

I just wanted to test if IUP controls would flicker on non-composite desktops under Windows on resize. I didn't mean to go in for SB that deep. :)

Under Windows, all the dependencies (dll's) being in the same folder would override their copies being  elsewhere so the disposition of dll's is not critical. As for the ini file, then why would scriba.exe execute the hangman.sb sample perfectly without any initialization while hanging with new_customer.sb?
« Last Edit: April 26, 2014, 06:42:40 PM by Mike Lobanovsky »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: IUP Resizing Example Please
« Reply #5 on: April 26, 2014, 06:56:43 PM »
Actually the only file you need to run a Script BASIC script is scriba.exe. This assumes you are not counting on using any of the extension modules in your script. The scriba -Eo yourpgm.exe yourpgm.bas will create a standalone .exe with the name of your choosing. Scriba always looks to see if a script is attached before processing any of its command line options.

Hangman must be core SB code.


Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: IUP Resizing Example Please
« Reply #6 on: April 26, 2014, 07:29:55 PM »
If you wanted to build a new_customer.exe that will run from one directory, do the following. This is so much easier if you just setup Script BASIC as I described above.

1. create a work directory.
2. Copy scriba.exe, upi.dll, iup.bas, iup.dll and new_customer.sb
3. At the console prompt in your work directory type scriba -Eo resize_demo.exe new_customer.sb
4. You can now send someone the resize_demo.exe, iup.dll and upi.dll to run on their system.

Option: Using sbiup.exe instead of scriba.exe will create a true Windows .exe without console support.

Note: No configuration files were used or harmed in the above procedure.

« Last Edit: April 26, 2014, 07:31:35 PM by John »

Mike Lobanovsky

  • Guest
Re: IUP Resizing Example Please
« Reply #7 on: April 26, 2014, 07:35:54 PM »
... I have attached the IUP DLLs (VC10 version) for you...

Perfect! Thanks a lot John, now it works like a charm! :) No linuxoid Cygwin stuff on my Windows disks any more! :D

Quote
The iup.bas goes in your Script BASIC include directroy.

Where do my project-specific includes go then? Into \include too? Not logical. I prefer to keep my project includes in the same folder as the main script.

And yes, double quotes are correct for my purposes. In SB4Win, IMPORT ".\xxxxxx.xxx" means import xxxxxx.xxx from same directory as the main script while IMPORT "C:\XXX\xxxxxx.xxx" will be a fully qualified absolute path that may even contain spaces. That's what I've found just now by trial and error. :)

Quote
The pui.dll goes in your Script BASIC modules directory.

As I said, there are several places where Windows searches for dll's on default. It always starts with the same folder where the main exe (scriba.exe or sbiup.exe) is. So if my sbiup.exe is in \4Mike then pui.dll that's in there too will make Windows stop on this very first hit. All other copies of pui.dll in any other project-specific paths or system directories will be ignored.

Quote
If the Script BASIC bin directory is in your search path then you can run the scripts from anywhere.
Proscribing SB's \bin into a system environment variable (~ search path) is usually done by the Windows installer. Similarly, file associations are usually established by that utility too. Windows is almost as well-automated in this respect as Mac OS X is.


Anyway, thanks a lot for your assistance, John, and please excuse me if I was too obtrusive with my request. At least I can have a working copy of GUI-enhanced SB now because I am capable of adding environment variables and file associations by hand. :) The core problem was in fact with the original IUP binaries for Windows. The poorer the vendor's site, the poorer the product.

Mike Lobanovsky

  • Guest
Re: IUP Resizing Example Please
« Reply #8 on: April 26, 2014, 07:37:30 PM »
Note: No configuration files were used or harmed in the above procedure.
Very humanistic! :D

Thanks again!

(Hehe, now I will be able to tease you with your benchmarks too... LOL)
« Last Edit: April 26, 2014, 07:56:26 PM by Mike Lobanovsky »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: IUP Resizing Example Please
« Reply #9 on: April 26, 2014, 07:58:30 PM »
upi.dll is not a standard Windows DLL. It is specific to SB and the modules directory. You can also use a full path to your include in your script and encapsulated with quotes. Files in the SB include directory supported by a SB config file only need a IMPORT iup.bas and SB knows where to find things. I'm pretty sure you can have multiple include definitions in the SCRIBA.INI if you wish.

« Last Edit: April 26, 2014, 08:02:29 PM by John »

Mike Lobanovsky

  • Guest
Re: IUP Resizing Example Please
« Reply #10 on: April 26, 2014, 08:08:55 PM »
upi.so is not a standard Windows DLL. (changed to upi.dll by JRS later on :) )
Isn't that supposed to be pui.dll? We're under Windows tonight (or today? What time is it now at your place? It's six in the morning here :) ).

Quote
It is specific to SB and the modules directory.
Not so in Windows, John. It's just another ordinary DLL here, nothing special.

Quote
I'm pretty sure you can have multiple include definitions in the SCRIBA.INI if you wish.
Down with configuration files, John! Not here, not in Windows. .INI files are his handiwork:



:D
« Last Edit: April 26, 2014, 08:15:31 PM by Mike Lobanovsky »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: IUP Resizing Example Please
« Reply #11 on: April 26, 2014, 08:58:45 PM »
Quote
Down with configuration files, John! Not here, not in Windows. .INI files are his handiwork:

Script BASIC's configuration file is a matter of convenience. It's not required but it saves me a lot of typing. For example ...

Code: [Select]
' ScriptBasic GFX - Alpha Circles

DECLARE SUB gfx_Window ALIAS "gfx_Window" LIB "gfx"
DECLARE SUB gfx_KeyName ALIAS "gfx_KeyName" LIB "gfx"
DECLARE SUB gfx_Update ALIAS "gfx_Update" LIB "gfx"
DECLARE SUB gfx_Close ALIAS "gfx_Close" LIB "gfx"
DECLARE SUB gfx_SDL_SetClipRect ALIAS "gfx_SDL_SetClipRect" LIB "gfx"
DECLARE SUB gfx_filledCircleRGBA ALIAS "gfx_filledCircleRGBA" LIB "gfx"
DECLARE SUB gfx_aapolygonRGBA ALIAS "gfx_aapolygonRGBA" LIB "gfx"
DECLARE SUB gfx_thickLineRGBA ALIAS "gfx_thickLineRGBA" LIB "gfx"
DECLARE SUB gfx_Time ALIAS "gfx_Time" LIB "gfx"
DECLARE SUB gfx_stringColor ALIAS "gfx_stringColor" LIB "gfx"

gfx_Window 640, 480, "ScriptBasic GFX"
' Random Value Arrays
RANDOMIZE(gfx_Time())
FOR i = 0 TO 512
  rx[i] = RND() % 640
  ry[i] = 60 + RND() % 480 - 80
  rz[i] = RND() % 64
  rr[i] = RND() AND  255
  rg[i] = RND() AND  255
  rb[i] = RND() AND  255
  af = rx[i] / 640
  ra[i] = INT(255 * af)
NEXT

ts = gfx_Time()
gfx_SDL_SetClipRect 0, 0, 640, 480
FOR i = 0 TO 512
  gfx_filledCircleRGBA rx[i], ry[i], rz[i], rr[i], rg[i], rb[i], ra[i]
NEXT
te = gfx_Time()
gfx_stringColor 20, 15,"Time: " & FORMAT("%.4f",(te-ts)/1000) & " Seconds." & CHR(0), 0xffffffff
gfx_Update
WHILE gfx_KeyName(1) <> "-escape"
WEND
gfx_Close

I can place my include file extension MODULE/END MODULE DECLAREs directly in the main script.  Or I can IMPORT/INCLUDE the extension module which includes them. If I have reusable code I normally stick it in a module. (BASIC or C)

Have a peek at the Script BASIC configuration file docs. It really has some great features besides just setting the include and module paths. All your MySQL DB setting/passwords can be setup in the config and you can do a mysql::Connect("db_id") The id is the name you gave your DB definition in the config file. SBHTTPD requires specific entries in this shared config file to work. (see my config I posted)

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: IUP Resizing Example Please
« Reply #12 on: April 27, 2014, 07:43:54 AM »
Quote
(Hehe, now I will be able to tease you with your benchmarks too... LOL

Script BASIC is an embeddable, multi-threaded cross platform scripting API. Scriba, sbhttpd, all the extension modules are just examples of how to use the Script BASIC API. I'm pleased folks have found value in these examples even if they have no embedding aspirations.

When you find a scripting API like Script BASIC then it would be fair to benchmark the code and compare features.

« Last Edit: April 27, 2014, 09:32:43 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: IUP Resizing Example Please
« Reply #13 on: April 27, 2014, 08:43:48 AM »
Mike,

The Script BASIC IUP extension module is only one of the methods to incorporate IUP under Windows. My focus on the Windows front with IUP is with Charles's DLLC extension module. This method is using a FFI approach and exposes the the multi-threaded aspect of SB. Charles pulled another rabbit out of his hat and allowed IUP to run in a threaded model which by default is not thread safe. I think you would have much more fun with SB if you used the DLLC ext. module with IUP. DLLC also allows calling standard DLL functions as threads, low level COM and BSTR support. The icing on the cake is that the MT extension module works with DLLC allowing shared (lockable R/W) variables and session support between threads and the main script. This module was created by Peter Verhas for the sbhttpd application web server that runs as a service.

Here is the iupinc.sb file I'm using with with DLLC.

Code: [Select]
' IUP DLLC Interface

  'DIAGNOSTICS 
  declare sub dllshow alias "dllshow" lib "DLLC"
  declare sub dllreco alias "dllreco" lib "DLLC"
  declare sub dllsecs alias "dllsecs" lib "DLLC"
  'DLL LINKAGE
  declare sub dllfile alias "dllfile" lib "DLLC"
  declare sub dllproc alias "dllproc" lib "DLLC"
  'DLL CALLS
  declare sub dllmeth alias "dllmeth" lib "DLLC"
  declare sub dllcall alias "dllcall" lib "DLLC"
  declare sub dllcald alias "dllcald" lib "DLLC"
  declare sub dllcalt alias "dllcalt" lib "DLLC"
  declare sub dllcobj alias "dllcobj" lib "DLLC"
  declare sub dllcobt alias "dllcobt" lib "DLLC"
  declare sub dllclbk alias "dllclbk" lib "DLLC"
  'SBCALLS
  declare sub dllprog alias "dllprog" lib "dllc"
  declare sub dllendp alias "dllendp" lib "dllc"
  declare sub dlltran alias "dlltran" lib "DLLC"
  declare sub dllclos alias "dllclos" lib "DLLC"
  'DATA
  declare sub dlltype alias "dlltype" lib "DLLC"
  declare sub dlldimv alias "dlldimv" lib "DLLC"
  declare sub dllfill alias "dllfill" lib "DLLC"
  declare sub dllgetm alias "dllgetm" lib "DLLC"
  declare sub dllputm alias "dllputm" lib "DLLC"
  declare sub dllfrem alias "dllfrem" lib "DLLC"
  'STRINGS / GUIDS
  declare sub dlldelo alias "dlldelo" lib "DLLC"
  declare sub dllostr alias "dllostr" lib "DLLC"
  declare sub dllzstr alias "dllzstr" lib "DLLC"
  declare sub dllastr alias "dllastr" lib "DLLC"
  declare sub dllwstr alias "dllwstr" lib "DLLC"
  declare sub dllcast alias "dllcast" lib "DLLC"
  declare sub dllguid alias "dllguid" lib "DLLC"


iup = dllfile("iup.dll")
iupcontrols = dllfile("iupcontrols.dll")
iupimglib = dllfile("iupimglib.dll")
iupcd = dllfile("iupcd.dll")
cd = dllfile("cd.dll")

' **********************
' IUP System Functions *
' **********************

IupOpen                     = dllproc(iup,"IupOpen                     cdecl i  = (i argc, i argv)")
IupClose                    = dllproc(iup,"IupClose                    cdecl      ()")
IupVersion                  = dllproc(iup,"IupVersion                  cdecl c* = ()")
IupLoad                     = dllproc(iup,"IupLoad                     cdecl c* = (c *filename)")
IupLoadBuffer               = dllproc(iup,"IupLoadBuffer               cdecl c* = (c *buffer)")
IupSetLanguage              = dllproc(iup,"IupSetLanguage              cdecl    = (c *lng)")
IupGetLanguage              = dllproc(iup,"IupGetLanguage              cdecl c* = ()")


' *************************
' IUP Attribute Functions *
' *************************

IupStoreAttribute           = dllproc(iup,"IupStoreAttribute           cdecl    = (i ih, c *name, c *value)")
IupStoreAttributeId         = dllproc(iup,"IupStoreAttributeId         cdecl    = (i ih, c *name, i id, c *value)")
IupSetAttribute             = dllproc(iup,"IupSetAttribute             cdecl    = (i ih, c *name, c *value)")
IupSetAttributeId           = dllproc(iup,"IupSetAttributeId           cdecl    = (i ih, c *name, i id, c *value)")
IupSetAttributes            = dllproc(iup,"IupSetAttributes            cdecl i  = (i ih, c *nameval)")
IupResetAttribute           = dllproc(iup,"IupResetAttribute           cdecl    = (i ih, c *name)")
IupSetAtt                   = dllproc(iup,"IupSetAtt                   cdecl i  = (c *handle_name, i ih, c *name)")
IupSetAttributeHandle       = dllproc(iup,"IupSetAttributeHandle       cdecl    = (i ih, c *name, i ih_named)")
IupGetAttributeHandle       = dllproc(iup,"IupGetAttributeHandle       cdecl i  = (i ih, c *name)")
IupGetAttribute             = dllproc(iup,"IupGetAttribute             cdecl c* = (i ih, c *name)")
IupGetAttributeId           = dllproc(iup,"IupGetAttributeId           cdecl c* = (i ih, c *name, i id)")
IupGetAllAttributes         = dllproc(iup,"IupGetAllAttributes         cdecl i  = (i ih, t *names, i max_n)")
IupGetAttributes            = dllproc(iup,"IupGetAttributes            cdecl c* = (i ih)")
IupGetFloat                 = dllproc(iup,"IupGetFloat                 cdecl f  = (i ih, c *name)")
IupGetFloatId               = dllproc(iup,"IupGetFloatId               cdecl f  = (i ih, c *name, i id)")
IupGetFloatId2              = dllproc(iup,"IupGetFloatId2              cdecl f  = (i ih, c *name, i lin, i col)")
IupGetInt                   = dllproc(iup,"IupGetInt                   cdecl i  = (i ih, c *name)")
IupGetInt2                  = dllproc(iup,"IupGetInt2                  cdecl i  = (i ih, c *name)")
IupGetIntInt                = dllproc(iup,"IupGetIntInt                cdecl i  = (i ih, c *name, i i1, i i2)")
IupGetIntId                 = dllproc(iup,"IupGetIntId                 cdecl i  = (i ih, c *name, i id)")
IupGetIntId2                = dllproc(iup,"IupGetIntId2                cdecl i  = (i ih, c *name, i lin, i col)")
IupStoreGlobal              = dllproc(iup,"IupStoreGlobal              cdecl    = (c *name, c *value)")
IupSetGlobal                = dllproc(iup,"IupSetGlobal                cdecl    = (c *name, c *value)")
IupGetGlobal                = dllproc(iup,"IupGetGlobal                cdecl c* = (c *name)")


' **********************
'  IUP Event Functions *
' **********************

IupMainLoop                 = dllproc(iup,"IupMainLoop                 cdecl i  = ()")
IupMainLoopLevel            = dllproc(iup,"IupMainLoopLevel            cdecl i  = ()")
IupLoopStep                 = dllproc(iup,"IupLoopStep                 cdecl i  = ()")
IupLoopStepWait             = dllproc(iup,"IupLoopStepWait             cdecl i  = ()")
IupExitLoop                 = dllproc(iup,"IupExitLoop                 cdecl    = ()")
IupFlush                    = dllproc(iup,"IupFlush                    cdecl    = ()")
IupGetCallback              = dllproc(iup,"IupGetCallback              cdecl i  = (i ih, c *name)")
IupSetCallback              = dllproc(iup,"IupSetCallback              cdecl i  = (i ih, c *cb_name, i funcaddr)")
IupSetCallbacks             = dllproc(iup,"IupSetCallbacks             cdecl i  = (i ih, c *name, i func)")
IupGetActionName            = dllproc(iup,"IupGetActionName            cdecl c* = ()")
IupSetFunction              = dllproc(iup,"IupSetFunction              cdecl i  = (c *name, i func)")
IupRecordInput              = dllproc(iup,"IupRecordInput              cdecl i  = (c *filename, i mode)")
IupPlayInput                = dllproc(iup,"IupPlayInput                cdecl i  = (c *filename)")


' **********************
' IUP Layout Functions *
' **********************

IupCreate                   = dllproc(iup,"IupCreate                   cdecl i  = (c *classname)")
' <?> Ihandle *IupCreatep(const char *classname, void* params0, ...)
IupDestroy                  = dllproc(iup,"IupDestroy                  cdecl    = (i ih)")
IupMap                      = dllproc(iup,"IupMap                      cdecl i  = (i ih)")
IupUnmap                    = dllproc(iup,"IupUnmap                    cdecl    = (i ih)")
IupGetAllClasses            = dllproc(iup,"IupGetAllClasses            cdecl i  = (t *names, i max_n)")
IupGetClassName             = dllproc(iup,"IupGetClassName             cdecl c* = (i ih)")
IupGetClassType             = dllproc(iup,"IupGetClassType             cdecl c* = (i ih)")
IupClassMatch               = dllproc(iup,"IupClassMatch               cdecl i  = (i ih, c *classname)")
IupGetClassAttributes       = dllproc(iup,"IupGetClassAttributes       cdecl i  = (c *classname, t *names, i max_n)")
IupGetClassCallbacks        = dllproc(iup,"IupGetClassCallbacks        cdecl i  = (c *classname, t *names, i max_n)")
IupSaveClassAttributes      = dllproc(iup,"IupSaveClassAttributes      cdecl    = (i ih)")
IupCopyClassAttributes      = dllproc(iup,"IupCopyClassAttributes      cdecl    = (i src_ih, i dst_ih)")
IupSetClassDefaultAttribute = dllproc(iup,"IupSetClassDefaultAttribute cdecl    = (c *classname, c *name, c *value)")
IupFill                     = dllproc(iup,"IupFill                     cdecl i  = ()")
IupHbox                     = dllproc(iup,"IupHbox                     cdecl i  = (i child)")
IupVbox                     = dllproc(iup,"IupVbox                     cdecl i  = (i child)")
IupZbox                     = dllproc(iup,"IupZbox                     cdecl i  = (i child)")
IupRadio                    = dllproc(iup,"IupRadio                    cdecl i  = (i child)")
IupNormalizer               = dllproc(iup,"IupNormalizer               cdecl i  = (i ih_first)")
IupCbox                     = dllproc(iup,"IupCbox                     cdecl i  = (i child)")
IupSbox                     = dllproc(iup,"IupSbox                     cdecl i  = (i child)")
IupSplit                    = dllproc(iup,"IupSplit                    cdecl i  = (i child1, i child2)")
IupAppend                   = dllproc(iup,"IupAppend                   cdecl i  = (i ih, i new_child)")
IupDetach                   = dllproc(iup,"IupDetach                   cdecl    = (i child)")
IupInsert                   = dllproc(iup,"IupInsert                   cdecl i  = (i ih, i ref_child, i new_child)")
IupReparent                 = dllproc(iup,"IupReparent                 cdecl i  = (i child, i new_parent, i ref_child)")
IupGetParent                = dllproc(iup,"IupGetParent                cdecl i  = (i ih)")
IupGetChild                 = dllproc(iup,"IupGetChild                 cdecl i  = (i ih, i pos)")
IupGetChildPos              = dllproc(iup,"IupGetChildPos              cdecl i  = (i ih, i child)")
IupGetChildCount            = dllproc(iup,"IupGetChildCount            cdecl i  = (i ih)")
IupGetNextChild             = dllproc(iup,"IupGetNextChild             cdecl i  = (i ih, i child)")
IupGetBrother               = dllproc(iup,"IupGetBrother               cdecl i  = (i ih)")
IupGetDialog                = dllproc(iup,"IupGetDialog                cdecl i  = (i ih)")
IupGetDialogChild           = dllproc(iup,"IupGetDialogChild           cdecl i  = (i ih, c *name)")
IupRefresh                  = dllproc(iup,"IupRefresh                  cdecl    = (i ih)")
IupRefreshChildren          = dllproc(iup,"IupRefreshChildren          cdecl    = (i ih)")
IupUpdate                   = dllproc(iup,"IupUpdate                   cdecl    = (i ih)")
IupUpdateChildren           = dllproc(iup,"IupUpdateChildren           cdecl    = (i ih)")
IupRedraw                   = dllproc(iup,"IupRedraw                   cdecl    = (i ih, i children)")
IupConvertXYToPos           = dllproc(iup,"IupConvertXYToPos           cdecl i  = (i ih, i x, i y)")


' **********************
' IUP Dialog Functions *
' **********************

IupDialog                   = dllproc(iup,"IupDialog                   cdecl i  = (i child)")
IupPopup                    = dllproc(iup,"IupPopup                    cdecl i  = (i ih, i x i y)")
IupShow                     = dllproc(iup,"IupShow                     cdecl i  = (i ih)")
IupShowXY                   = dllproc(iup,"IupShowXY                   cdecl i  = (i ih, i x i y)")
IupHide                     = dllproc(iup,"IupHide                     cdecl i  = (i ih)")
IupFileDlg                  = dllproc(iup,"IupFileDlg                  cdecl i  = ()")
IupMessageDlg               = dllproc(iup,"IupMessageDlg               cdecl i  = ()")
IupColorDlg                 = dllproc(iup,"IupColorDlg                 cdecl i  = ()")
IupFontDlg                  = dllproc(iup,"IupFontDlg                  cdecl i  = ()")
IupAlarm                    = dllproc(iup,"IupAlarm                    cdecl i  = (c *t, c *m, c *b1, c *b2, c *b3)")
IupGetFile                  = dllproc(iup,"IupGetFile                  cdecl i  = (c *filename)")
IupGetColor                 = dllproc(iup,"IupGetColor                 cdecl i  = (i x, i y, i *r, i *g, i *b)")
' <?> IupGetParam                 = dllproc(iup,"IupGetParam                 cdecl i  = (c *title, i action, void* user_data, c *format)")
' <?> int IupGetParam(const char* title, Iparamcb action, void* user_data, const char* format,...)
IupGetText                  = dllproc(iup,"IupGetText                  cdecl i  = (c *title, c *text)")
IupListDialog               = dllproc(iup,"IupListDialog               cdecl i  = (i type, c *title, i size, t *list, i op, i max_col, i max_lin, i marks)")
IupMessage                  = dllproc(iup,"IupMessage                  cdecl    = (c *title, c *message)")
IupLayoutDialog             = dllproc(iup,"IupLayoutDialog             cdecl i  = (1 dialog)")
IupElementPropertiesDialog  = dllproc(iup,"IupElementPropertiesDialog  cdecl i  = (i elem)")


' ***********************
' IUP Control Functions *
' ***********************

IupButton                   = dllproc(iup,"IupButton                   cdecl i  = (c *title, c *action)")
IupCanvas                   = dllproc(iup,"IupCanvas                   cdecl i  = (c *action)")
IupFrame                    = dllproc(iup,"IupFrame                    cdecl i  = (i child)")
IupLabel                    = dllproc(iup,"IupLabel                    cdecl i  = (c *title)")
IupList                     = dllproc(iup,"IupList                     cdecl i  = (c *action)")
IupMultiLine                = dllproc(iup,"IupMultiLine                cdecl i  = (c *action)")
IupProgressBar              = dllproc(iup,"IupProgressBar              cdecl i  = ()")
' IupGauge                    = dllproc(iup,"IupGauge                    cdecl i  = ()")
IupSpin                     = dllproc(iup,"IupSpin                     cdecl i  = ()")
IupTabs                     = dllproc(iup,"IupTabs                     cdecl i  = (i child)")
IupTabsv                    = dllproc(iup,"IupTabsv                    cdecl i  = (t *children)")
IupText                     = dllproc(iup,"IupText                     cdecl i  = (c *action)")
IupToggle                   = dllproc(iup,"IupToggle                   cdecl i  = (c *title, c *action)")
IupTree                     = dllproc(iup,"IupTree                     cdecl i  = ()")
IupVal                      = dllproc(iup,"IupVal                      cdecl i  = (c *orientation)")


' ************************
' IUP Resource Functions *
' ************************

IupImage                    = dllproc(iup,"IupImage                    cdecl i  = (i width, i height, c *pixels)")
IupImageRGB                 = dllproc(iup,"IupImageRGB                 cdecl i  = (i width, i height, c *pixels)")
IupImageRGBA                = dllproc(iup,"IupImageRGBA                cdecl i  = (i width, i height, c *pixels)")
IupNextField                = dllproc(iup,"IupNextField                cdecl i  = (i ih)")
IupPreviousField            = dllproc(iup,"IupPreviousField            cdecl i  = (i ih)")
IupGetFocus                 = dllproc(iup,"IupGetFocus                 cdecl i  = ()")
IupSetFocus                 = dllproc(iup,"IupSetFocus                 cdecl i  = (i ih)")
IupItem                     = dllproc(iup,"IupItem                     cdecl i  = (c *title, c *action)")
IupMenu                     = dllproc(iup,"IupMenu                     cdecl i  = (i child)")
IupMenuv                    = dllproc(iup,"IupMenuv                    cdecl i  = (t *children)")
IupSeparator                = dllproc(iup,"IupSeparator                cdecl i  = ()")
IupSubmenu                  = dllproc(iup,"IupSubmenu                  cdecl i  = (c *title, i menu)")
IupSetHandle                = dllproc(iup,"IupSetHandle                cdecl i  = (c *name, i ih)")
IupGetHandle                = dllproc(iup,"IupGetHandle                cdecl i  = (c *name)")
IupGetName                  = dllproc(iup,"IupGetName                  cdecl c* = (i ih)")
IupGetAllNames              = dllproc(iup,"IupGetAllNames              cdecl i  = (t *names, i max_n)")
IupGetAllDialogs            = dllproc(iup,"IupGetAllDialogs            cdecl i  = (t *names, i max_n)")
IupClipboard                = dllproc(iup,"IupClipboard                cdecl i  = ()")
IupTimer                    = dllproc(iup,"IupTimer                    cdecl i  = ()")
IupUser                     = dllproc(iup,"IupUser                     cdecl i  = ()")
IupHelp                     = dllproc(iup,"IupHelp                     cdecl i  = (c *url)")


' **************
' IUP Controls *
' **************

IupControlsOpen             = dllproc(iupcontrols,"IupControlsOpen     cdecl i  = ()")
IupMatrix                   = dllproc(iupcontrols,"IupMatrix           cdecl i  = (c *action)")
IupImageLibOpen             = dllproc(iupimglib,"IupImageLibOpen       cdecl    = ()")


' IUP Global Constants

GLOBAL CONST NUL = 0X0

' **********************
' Common Return Values *
' **********************
GLOBAL CONST IUP_ERROR    =  1
GLOBAL CONST IUP_NOERROR  =  0
GLOBAL CONST IUP_OPENED   = -1
GLOBAL CONST IUP_INVALID  = -1

' ************************
' Callback Return Values *
' ************************
GLOBAL CONST IUP_IGNORE   = -1
GLOBAL CONST IUP_DEFAULT  = -2
GLOBAL CONST IUP_CLOSE    = -3
GLOBAL CONST IUP_CONTINUE = -4

' *****************************************
' IupPopup and IupShowXY Parameter Values *
' *****************************************
GLOBAL CONST IUP_CENTER        = 0xFFFF
GLOBAL CONST IUP_LEFT          = 0xFFFE
GLOBAL CONST IUP_RIGHT         = 0xFFFD
GLOBAL CONST IUP_MOUSEPOS      = 0xFFFC
GLOBAL CONST IUP_CURRENT       = 0xFFFB
GLOBAL CONST IUP_CENTERPARENT  = 0xFFFA
GLOBAL CONST IUP_TOP           = 0xFFFE
GLOBAL CONST IUP_BOTTOM        = 0xFFFD


FUNCTION SB_CreateImg(text)
  LOCAL i, strip, array, binstr
  strip = " " & CHR(9) & CHR(10) & CHR(13)
  FOR i = 1 TO LEN(strip)
    text = REPLACE(text, MID(strip, i, 1), "")
  NEXT i
  SPLITA text BY "," TO array
  FOR i = 0 TO UBOUND(array)
    binstr &= CHR(array[i])
  NEXT i
  SB_CreateImg = binstr
END FUNCTION

Note: DLLC is a OxygenBasic extension module for Script BASIC. You will find the current source in the ProjectB\ScriptBasic directory of the O2 WIP ZIP. (wizard offering)
« Last Edit: April 27, 2014, 09:18:32 AM by John »

Mike Lobanovsky

  • Guest
Re: IUP Resizing Example Please
« Reply #14 on: April 27, 2014, 06:22:35 PM »
John,

Thanks for this brief intro to the charms of Script BASIC. Seriously, I do see that a lot of effort has been put into SB by several talented people over the years since its very beginning to promote its integration in, and interfacing with, other mature contemporary HLL's.

So far it is

i) heavily modularized (otherwise bare-bones console/terminal and 3rd-party API),
ii) embeddable (in procedural languages),
iii) 64-bit capable,
iv) multi-threaded,
v) bi-platform,
vi) monolingual, and
vii) not OOP capable natively.

Charles' OxygenBasic is

i) all-in-one (bare-bones and 3rd-party API),
ii) embeddable (in procedural languages),
iii) 64-bit capable,
iv) multi-threaded,
v) (yet) single-platform,
vi) bilingual, and
vii) OPP capable natively.

Mike's FBSL is

i) all-in-one multi-purpose (integrated console, GUI, graphics, XML, COM, sockets, MMF, hash tables, matrix maths, RegExp, zip compression, 3rd-party API),
ii) embeddable (COM like SAP's ABAP, via FbslX.dll, and procedural, via Fbsl.dll),
iii) not (yet) 64-bit capable,
iv) multi-threaded asm and C and mutex-controlled BASIC,
v) (yet) single-platform,
vi) trilingual, and
vii) OOP capable natively.

My analysis isn't pretending to be exhaustive because my picture may simply not be full and/or entirely objective. Nor do I want to compare who's better (though I do like to check out occasionally who's faster). I realize pretty well that everyone must have some strong points in their creation otherwise there's no point in creating anything in the first place. But I also realize that 64-bit capability and/or expansion to other platforms are the motive force (in both senses of the word) behind Charles' and my own projects that's still keeping us alive and kicking. And I don't see why either of us shouldn't succeed with what we're planning to do in the long or short run.

I am not against SB in the least. I just meant to hint that now your windowed apps will most definitely be amongst the subjects of my experimentation should I ever decide to launch another small and private Mandelbrot test. ;)

As for IUP, it does flicker just as any native GUI should on a non-composited desktop of Windows XP or in a Classic theme of later Windows operating systems. If I'm able to cut out some of its non-standard controls that don't go well with non-Linux environments thus bringing down its remaining size to about 300-400KB, perhaps I should also regard it as a suitable basis for multi-platform GUI layer of FBSL. If it could also be cross-breeded with Armando's ClaroMac instead of its own X11 solutions deprecated in recent versions of Mac OS X, then the library might be a perfect match for my plans.