Liberty BASIC Community Forum
« Feature Suggestion »

Welcome Guest. Please Login or Register.
Sep 21st, 2017, 11:29pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Feature Suggestion  (Read 761 times)
mmiscool
Team Liberty BASIC


member is offline

Avatar



AIM
Homepage PM

Gender: Male
Posts: 226
xx Feature Suggestion
« Thread started on: May 11th, 2012, 12:38pm »

A feature I would like to have is option to save a bunch of variables to a file including whole arrays. A command to load that back in to a program at any time. An example is some thing along the lines of the following.

For specific variables
Code:
SaveVars “c:\coolfile.bla”, “AnArray$(, Yay$, Yep” 

Or
For all variables used in the program
Code:
SaveVars “c:\coolfile.bla” 


Then to load those variables with pre loaded values in to any program just use the LoadVars command.

Code:
LoadVars “c:\coolfile.bla”

Print Yay$
Print Yep 


I personally think that this would be awesome.
User IP Logged

http://mmiscool.com
http://esp8266basic.com
http://smbisoft.com
Joseph
Board Moderator

member is offline

Avatar

Hello, World!


PM

Gender: Male
Posts: 854
xx Re: Feature Suggestion
« Reply #1 on: May 11th, 2012, 3:09pm »

If I'm not mistaken, eval/eval$() will get you pretty far with that, Mike.
« Last Edit: May 11th, 2012, 3:09pm by Joseph » User IP Logged

My Personal LB Project Page
Twitter GitHub
My App
tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1681
xx Re: Feature Suggestion
« Reply #2 on: May 12th, 2012, 12:21am »

Quote:
If I'm not mistaken, eval/eval$() will get you pretty far with that, Mike.

Well, NO

You can't even save the array because LB lacks commands to retrieve array dimension by name

And you cannot use EVAL in present form to assign variable by variable name AT ALL (and it really looks like it will not change, see
The EVAL() function in LB5 will get improved, reply #5 and beyond)
« Last Edit: May 12th, 2012, 12:22am by tsh73 » User IP Logged

damned Dog in the Manger
chad3006
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 25
xx Re: Feature Suggestion
« Reply #3 on: Jun 26th, 2012, 2:40pm »

Here's a suggestion, and forgive me if it has already been suggested or implemented, but I think the ability to open multiple .bas files in one instance of the Liberty BASIC IDE would be handy.

To clarify, something similar to this:

User Image

Edit: I checked the Linux screenshots and apparently it's in the works -- so nevermind.
« Last Edit: Jun 26th, 2012, 2:46pm by chad3006 » User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 186
xx Re: Feature Suggestion
« Reply #4 on: Feb 16th, 2013, 08:02am »

It probably sounds like a trivial request, but being able to designate and change button colors would be a tremendous improvement for one of the programs I'm working on. Maybe?
User IP Logged

tenochtitlanuk
Board Moderator

member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1162
xx Re: Feature Suggestion
« Reply #5 on: Feb 16th, 2013, 11:42am »

Not quite sure what you are asking for that bmpbutton ( example in the Help files) does not provide- you can create separate bitmaps to send to a named bmpbutton with colour, image, text etc in whatever variations you want- as long as they all have the same x/y dimensions.
EDIT Are you wanting to change radiobutton colours?
And have you thought of painting your buttons onto a graphicbox and using mouse x/y to paint a new graphic of changed colour??
Lots of possibilities within current language spec'n.
« Last Edit: Feb 16th, 2013, 11:52am by tenochtitlanuk » User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 186
xx Re: Feature Suggestion
« Reply #6 on: Feb 18th, 2013, 09:26am »

tenochtitlanuk: Thanks for your comments and sorry for the delay. I'm just talking about "simple" push buttons. I could be totally mistaken, but while I can change the label (text) display on the button, I can't select or change the color of the button.

I've been playing with bitmaps, but while I can change color, I don't know how to include or change text or if it's even possible. At any rate, it sure would be great if a color could be associated with a regular push button.
User IP Logged

tenochtitlanuk
Board Moderator

member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1162
xx Re: Feature Suggestion
« Reply #7 on: Feb 18th, 2013, 12:49pm »

If the image below shows the kind of thing you want, download the example file.
User Image
User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 186
xx Re: Feature Suggestion
« Reply #8 on: Feb 18th, 2013, 3:32pm »

Tenochtitlanuk: Thanks again; that's what I'm looking for. However, I don't see where you get the red, blue, green, and grey bmp's or how you designate the "Go", "Blue", "Hot" button legends, as they're not in the example code. What am I missing? In other words, it works fine, but I don't have a clue why! I guess I flat don't understand how you created the bmp's and where they're located? ... I think I'm losing what's left of my mind! ;D
User IP Logged

tenochtitlanuk
Board Moderator

member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1162
xx Re: Feature Suggestion
« Reply #9 on: Feb 18th, 2013, 4:03pm »

Liberty comes with about 150 bmp images for jobs like this. They are in C:\Program Files\Liberty BASIC v4.04\bmp\ on my XP machine. Hover your mouse over any one to get its properties, including its pixel size.
User Image
From there I loaded Blank3.bmp ( which is 25 by 25) into my favourite ( free) image editor- GIMP. I scaled it 200% horizontally; tipped paint in; chose a font, size & colour, & typed the text. Exported as a bmp with a new name. Undid the stages back to the stretched original, did another version. Ended with four bmps to use. When you un-zipped my example file, you'd be seeing these bmps along with the BASIC code. And in the code you see lines where these bmps are loaded and given an internal name with which they can be placed on a bmpbutton.
Code:
  loadbmp "red",      "red.bmp"
  loadbmp "blue",    "blue.bmp"
  loadbmp "green",  "green.bmp"
  loadbmp "grey",    "grey.bmp"

  bmpbutton  #main.button1, "grey.bmp", [button1Click], LR, 80, 30 

This means I have, ready for use, images called 'red', 'blue' 'green' and 'grey', and the button is initially loaded with 'grey' image.
Later lines like
Code:
#main.button1 "bitmap red" 

just swap out the present bitmap and replace it with a new one.
The 'Help File' should be your guide. Just look for 'bmpbutton'!!
Code:
BMPBUTTON COMMANDS
print #handle.ext, "bitmap bitmapname" 

Modern practice is to omit the 'print' and the comma.

(PS As a matter of housekeeping good-practice, you may prefer to keep images in a sub-directory of the directory where you store your *.bas file. And you can load bmps using full pathnames including drive name & higher directories if your user permissions allow such access)
User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 186
xx Re: Feature Suggestion
« Reply #10 on: Feb 18th, 2013, 5:03pm »

Tenochtitlanuk: Thanks once more. I've browsed the bmp library before, and am using a couple of them already, but I didn't see the bmp's used in your example. I figured you must have constructed them, but I've never done that before and was pretty much clueless. I'll give it a good look tomorrow. (A tough session at the gym, dinner, and happy hour have wiped me out for the rest of this evening!)

Still, my suggestion of making color changes for "regular" buttons seems a whole lot easier! I'll play with this tomorrow and can hopefully replace a bunch of small "status indicators". Your help is very much appreciated.
« Last Edit: Feb 18th, 2013, 5:09pm by Turtleman » User IP Logged

Stefan Pendl
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Computers are like babies, you must teach them what you like them to do ...


Homepage PM

Gender: Male
Posts: 5295
xx Re: Feature Suggestion
« Reply #11 on: Feb 19th, 2013, 02:26am »

You can even create those button images on the fly in a graphics control, which would allow using the users theme for the font and such.
User IP Logged

Stefan

Make sure to read and follow the Forum Guidelines

Liberty BASIC Pro 4.04, Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5526
xx Re: Feature Suggestion
« Reply #12 on: Feb 19th, 2013, 02:43am »

Quote:
my suggestion of making color changes for "regular" buttons seems a whole lot easier!


Just a small point about that, Liberty uses whatever "scheme" the user has selected, that may include colored, high contrast or large icon buttons. That's the way Windows GUI works, the user chooses how their display looks.

Much bypassed these days with all sorts of fancy graphic buttons in use but that was the original concept and is why Liberty offers "ordinary" buttons.
User IP Logged

Turtleman
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 186
xx Re: Feature Suggestion
« Reply #13 on: Feb 19th, 2013, 05:22am »

I'm obviously going to have to spend a lot more time in "how to make bmp's" class! And as usual, I'm humbled by the apparent simplicity of the example code. Undoubtedly, it would have taken me two or three times as many instructions do the same thing. For example, I likely would have designated the (same) location for each of the four bmp buttons separately and probably thrown in a bunch of "if" statements instead of "select case." My app is about 13K lines of code, and I suspect a "real" LB programmer could whittle it down to considerably less than half that amount, while making it run faster at the same time. (I now have to decide if I really like changing button colors more than the status indicators, but that's another subject.)

By the way, maybe you've seen my other recent posts about graphics running noticeably slower on Win7 than XP. Thanks to Stefan, it turned out being entirely due to Win7's Aero Peek. Does anyone know any way to get around that slowdown without turning that feature off?

Thanks again for everyone's help.
« Last Edit: Feb 19th, 2013, 05:27am by Turtleman » User IP Logged

garretthylltun
New Member
Image


member is offline

Avatar




PM


Posts: 48
xx Re: Feature Suggestion
« Reply #14 on: Feb 22nd, 2013, 07:53am »

on Feb 19th, 2013, 05:22am, Turtleman wrote:
Thanks to Stefan, it turned out being entirely due to Win7's Aero Peek. Does anyone know any way to get around that slowdown without turning that feature off?


Control Panel > System > Performance Information and Tools.

New window opens and should already be at the "Visual Effects" tab. Simply look for "Enable Areo Peek" and deselect it and click apply.

Oops, my bad, just re-read your reply and you said "without turning that feature off"... disregard my instructions.
« Last Edit: Feb 22nd, 2013, 07:55am by garretthylltun » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls