vs GUI Updates - the latest from b+ - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Prolific Programmers (https://staging.qb64phoenix.com/forumdisplay.php?fid=26) +---- Forum: bplus (https://staging.qb64phoenix.com/forumdisplay.php?fid=36) +---- Thread: vs GUI Updates - the latest from b+ (/showthread.php?tid=689) |
RE: vs GUI Updates - the latest from b+ - bplus - 08-10-2022 OK done! and I found out I had to fix the drwPic code in the BM. Now I have Horizontal slider code and some practice using it. Here is a brief graph of what variables L, B, D and w represent from the article vince took the equation from: And here is my vs GUI with sliders reshaping the Egg And the zip package of project: RE: vs GUI Updates - the latest from b+ - vince - 08-11-2022 wow, nice mod B+, very well composed. It is interesting how you can edit the number textboxes but the sliders overrule. First look at the code, it does look tricky to program, I will take a closer look and see RE: vs GUI Updates - the latest from b+ - bplus - 08-11-2022 Hi vince, Yeah about the text boxes, I started with the picture and one textbox to test changes in w, and a button to redraw with text box value. It soon became obvious that a slider would be way more fun so I dumped the redraw button and used the text boxes as labels to show where the sliders were at number wise. I should change the Text boxes to labels. When I was doing this I came to realization that it is bad idea to lock all the library code up in a separate module. You can't possibly do GUI without knowing those routines like the back of your hand. I am constantly referring back to them to check on some detail. Eh, there has got to be a better way. Even though I don't want to add a slider control to the list, we could add a Slider type to store slider data and have a common sub to handle the different sliders. RE: vs GUI Updates - the latest from b+ - vince - 08-11-2022 I just noticed there's another file, B+ vs GUI.txt, which is a nice write-up and should be helpful. I think the main issue with all these GUI toolkits, inform included, is that they don't really fit any kind of niche to be reused by the community at large. If I wanted GUI elements in my QB64 mods I'd probably prefer to roll my own in true BASIC spirit and it would likely end up being simpler than adapting a more fully-featured library. ie just hard-code a couple of buttons and sliders and be done with it. If I wanted something truly fully featured industry-standard GUI in the realm of GTK or windows API or similar then I'd look well away from QB64 as the base language. RE: vs GUI Updates - the latest from b+ - bplus - 08-11-2022 I don't know, it is very handy to do multiple inputs, multiple lists, multiple buttons is pretty easy but doing the mouse zone stuff for them could get boring. Here it's all setup in a GUI. I am not going to call it vs any more because it is not that simple to learn to use it, you might actually have to spend an hour or so learning and more hours of practice. But again it is handy for multiple's specially List Boxes and Text Boxes. The BM code is still under 1K if you remove all the comments I add and lot's of handy stuff you'd want in any app, filled circles and triangles, Split and Join, Directory and File lists. The Accounts Tracker is basically an Fields Editor for a Database app, with a tiny bit of calculation going on for one of the Fields. RE: vs GUI Updates - the latest from b+ - bplus - 08-11-2022 Ha, now with that pep talk I can go back to Controls Editor and throw out the Get_Filename controls because it is working just fine as an independent program called in a Shell to get a pathed filename PLUS you can do other stuff with it like Kill some files you dont need anymore while you are browsing your system. And rewrite the egg designer thing with Slider Type setup and common sub plus probably a Dim Shared Slider array, (text boxes converted to labels). RE: vs GUI Updates - the latest from b+ - bplus - 08-12-2022 OK I have reworked the slider code. Since it comes in a picture box there is already a label we can use to keep it self contained all-in-one slider box. and I reworked it again 2022-08-12, sorry just trying to get it right! The 3.4100000001 values in slider labels were making me crazy when they were supposed to be 3.41! So I added Steve's N2S$ for converting sci notation to normal layman and added my Round2$ function for rounding the display number to dp or 10^dp place in the decimal number eg, -2 = hundreths Here is screen shot of the remake 2022-08-12: I used 2 decimals with first slider, w, 3 for next, D, and 4 decimals for last two variables L, B. And look how simple the code is! (2022-08-12 code just added 4 lines to code posted yesterday) Code: (Select All) Option _Explicit ' b+ 2022-08-11 & 12 Perfect little demo for horz. sliders Zip has the revised BI/BM code to do the new sliders. EDIT 2022-08-12 everything completely changed out for label fix in Sliders, you can now spec the decimal precision to display. RE: vs GUI Updates - the latest from b+ - bplus - 08-12-2022 Note: 2022-08-12 Previous post has been completely changed out and updated since yesterday 8-11 (no one had downloaded yesterday's anyway). Fixed precision display in slider labels. The old trick Int(x * 100) / 100 does not always work and sometimes get 3.4100000001 when all I wanted was 3.41. RE: vs GUI Updates - the latest from b+ - bplus - 08-13-2022 I was running through all the GUI apps testing with the new BI/BM and found a bug in the Accounts Tracker app. I have been using it for over a week and never noticed the Insert button doesn't get the amount, so the balance isn't changed. It gets a new line inserted but misses the amount, a single line missing in code. So here is the fix for that with the latest BI/BM and docs: RE: vs GUI Updates - the latest from b+ - bplus - 08-13-2022 OK tried Kens Artillery with Sliders, had to move stuff around, very handy to have adjustable start and stop values so can put the angles between 40 and 80 degrees and power 50 to 100% otherwise half the slider would be wasted starting at 0's. |