Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IupProgressBar->VALUE #11

Open
cmatzenbach opened this issue Mar 23, 2018 · 4 comments
Open

IupProgressBar->VALUE #11

cmatzenbach opened this issue Mar 23, 2018 · 4 comments
Assignees

Comments

@cmatzenbach
Copy link
Collaborator

No description provided.

@zNeill
Copy link
Collaborator

zNeill commented Mar 23, 2018

Value is working but as a next step need to implement the default MIN and MAX values as 0 and 1 per the documentation.

@zNeill
Copy link
Collaborator

zNeill commented Mar 23, 2018

@ewmailing There isn't an equivalent of the "MIN" property ( https://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupprogressbar.html) in HTML. The HTML5 progress widget only has "value" and "max" properties as per W3 documentation:
https://www.w3schools.com/tags/tag_progress.asp

Do you think it would be problematic to skip implementation of the IupProgressBar min property? Can you think of practical uses of a non-zero min property in Iup programs?

@ewmailing
Copy link
Owner

MIN is an important property that will break programs if you don't support it. It is a convenience feature, and I'm sure there are plenty of real-world cases that prefer to use their natural range instead of always normalizing between some artificial range, such as [0 to 1], [0 to 100], [0 to 1000], [-1 to 1], etc. Imagine an app that follows the progress of boiling water in F. That would scale would go from [32, 212].

I think this should be easy enough to fake. You just need to renormalize values between the user's specified MIN and MAX.

So when they set the current VALUE (progress), that is already in their units (say Fahrenheit). So if they set 32, then you renormalize it so it is 0.

And when they get the current VALUE, you convert the other way from your html widget to the user's units. So if the bar is 0, then it is 32.

@zNeill
Copy link
Collaborator

zNeill commented Mar 23, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants