|
Post by Pjot on Feb 24, 2019 21:45:41 GMT 1
Guys, Just an update on where the Turbo Vision port is going - see the code below screenshot. It is very similar to the HUG API except for the radio- and check buttons, but this turns out to be a pretty nice change IMHO. BR Peter
INIT
wdw = WINDOW("BMI Calculation", 50, 20)
btn = BUTTON("~S~how BMI", 12, 2) ATTACH(wdw, btn, 1, 10) CALLBACK(btn, Calc_BMI)
mrk = MARK("Your BMI is: ", 25, 1) ATTACH(wdw, mrk, 2, 8)
btn = STOCK("Quit", 11, 2) ATTACH(wdw, btn, 37, 17)
mrk1 = MARK("Enter your weight (kg): ", 25, 1) ATTACH(wdw, mrk1, 2, 2)
txt1 = ENTRY("", 23, 1) ATTACH(wdw, txt1, 2, 3)
mrk2 = MARK("Enter your height (cm): ", 25, 1) ATTACH(wdw, mrk2, 2, 5)
txt2 = ENTRY("", 23, 1) ATTACH(wdw, txt2, 2, 6)
' List and entries lst = LIST(17, 6) TEXT(lst, "Item 1") TEXT(lst, "Item 2") TEXT(lst, "Item 3") TEXT(lst, "Item 4") TEXT(lst, "Item 5") TEXT(lst, "Item 6") TEXT(lst, "Item 7") TEXT(lst, "Item 8") ATTACH(wdw, lst, 29, 2)
btn = BUTTON("~L~ist current item", 20, 2) ATTACH(wdw, btn, 28, 10) CALLBACK(btn, List_Item)
' Check buttons in one group checkgroup = CHECK("Use milk", 15, 1) TEXT(checkgroup, "Use sugar") TEXT(checkgroup, "Use sirop") TEXT(checkgroup, "Extra shot") ATTACH(wdw, checkgroup, 2, 14)
' Radio buttons in one group radiogroup = RADIO("Use milk", 15, 1) TEXT(radiogroup, "Use sugar") TEXT(radiogroup, "Use sirop") TEXT(radiogroup, "Extra shot") ATTACH(wdw, radiogroup, 19, 14)
FOCUS(txt1)
DISPLAY Attachments:hug_tv.bac.gz (3.13 KB)
|
|
|
Post by bigbass on Feb 24, 2019 22:15:06 GMT 1
Hello Peter
That's very clean syntax
I prefer the way you did check and radio because now it would be easy to do radiogroup2 and checkgroup2 when you need to add more
and we dont need to add all the PRAGMA lines and the DECLARES
imagine if someone kept the original syntax clean they would have never made it open souce! so I guess it was all a good thing in the end
Joe
|
|
|
Post by Pjot on Mar 11, 2019 21:15:15 GMT 1
All, The latest update on the Turbo Vision stuff. It's been pretty difficult to reach full HUG compliancy, so I have reached the point to rethink the high-level API altogether... Anyway, below a screenshot of my latest test program, and attached the code, which contains some information as well. BR Peter Attachments:hug_tv.bac.gz (4.5 KB)
|
|
|
Post by vovchik on Mar 11, 2019 23:15:27 GMT 1
Dear Peter,,
Thanks. I tried it out and everything is working as it should. It does look very much like the normal HUG, which has every understandable syntax. Very nice.
With kind regards, vovchik
|
|
|
Post by bigbass on Mar 12, 2019 20:26:41 GMT 1
Hello Peter Worked for me too The C++ code for callbacks is very different than fltk I am going to port this demo to fltk and see why or if we need the global :: in the subs or just do a cloned version with callbacks to compare the toolkits just to wrap my thinking on how to convert the code its good to see that C++ GUI"s are portable to BaCon Joe
|
|