|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
DanRRight
Joined: 10 Mar 2008 Posts: 2828 Location: South Pole, Antarctica
|
Posted: Fri Aug 29, 2014 7:13 am Post subject: Dynamically updated %il and %sl |
|
|
Clearwin+ allow to update many its controls dynamically.
The %il, %fl, %dd and %sl are still among few exceptions.
Here are few examples how things look right now.
If you change the limits, both the %il or slider %sl still
use older hardwired parameters taken at load time.
Attempts to make a workaround opening one more
window, change the limits there and push them with
window_update@(limits) to change
does nothing.
So changing the limits forces the user to close the
window and open it again which looks like a pity
design defect
SLIDER CODE
Code: | real*8 aMin, aMax, aVal
aMin=0
aMax=1
i=winio@('Slide between these two numbers %6rf%6rf&', aMin, aMax)
i=winio@(' %30sl&',aVal, aMin, aMax)
i=winio@(' %rf&',aVal)
i=winio@('%ac[esc]','exit')
end |
INTEGER LIMIT CODE
Code: | integer iMin, iMax, iVal
iMin=0
iMax=10
i=winio@('Run the wheel up between these two numbers %6rd%6rd&', iMin, iMax)
i=winio@('Run the wheel up %dd%il%6rd%`il&', 1, iMin, iMax, ival)
i=winio@('%ac[esc]','exit')
end |
Workaround for INTEGER LIMIT CODE
Code: | common iMin, iMax, iVal
integer cb
external cb
iMin=0
iMax=10
i=winio@('Run the wheel up between these two numbers %6rd%6rd&', iMin, iMax)
i=winio@(' %dd%il%6rd%`il%ff&', 1, iMin, iMax, ival)
i=winio@('%^bt[Change limits]&', cb)
i=winio@('%ac[esc]','exit')
end
integer function cb ()
common iMin, iMax, iVal
i=winio@('%cn Change the wheel limits %6rd%6rd&', iMin, iMax)
i=winio@('%ac[esc]','exit')
call window_update@(iMin)
call window_update@(iMax)
cb=2
end function |
Besides, if happen that the limits in %il have equal values it crashes the code, which at least it shouldn't do, the control must just do nothing
Last edited by DanRRight on Fri Aug 29, 2014 9:55 am; edited 7 times in total |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Fri Aug 29, 2014 7:33 am Post subject: |
|
|
Thanks Dan. I have added this to the wish list. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Fri Aug 29, 2014 7:02 pm Post subject: |
|
|
I think I observed some years ago that having the limits the same appears to be inadmissable, and if you are revisiting this, then perhaps you could look at the case of the two limits the same and then turning the box into 'not editable'.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Sat Aug 30, 2014 6:30 am Post subject: |
|
|
Thanks Eddie. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2828 Location: South Pole, Antarctica
|
Posted: Sun Aug 31, 2014 1:33 pm Post subject: |
|
|
Eddie, If graying the edit box control is dynamically updatable and will not essentially need directing the code into new place with if-then and closing/reopening the window than this is the solution. But do you think allowing the same limits in %il violates some design guidances and rules? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Tue Feb 10, 2015 1:31 pm Post subject: |
|
|
It turns out that there are existing undocumented functions for this but they currently do not work with %dd. Here is a sample program.
Code: | winapp
program main
include <windows.ins>
integer n,ctrl,hwnd
n = 0
i = winio@("%il&", 0, 100)
!!!!i = winio@("%dd&", 10)
i = winio@("%rd&", n)
i = winio@("%lc&", hwnd)
i = winio@("%lw", ctrl)
call set_integer_limits@(hwnd, 0, 30)
end
|
The next release includes a fix to make this work for %dd.
For double precision values call set_float_limits@. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Tue Feb 10, 2015 5:05 pm Post subject: |
|
|
Brilliant!
And can we have the case of both limits being identical making the control read only please?
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Tue Feb 10, 2015 5:41 pm Post subject: |
|
|
OK. This has now been added to set_integer_limits@. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2828 Location: South Pole, Antarctica
|
Posted: Tue Feb 10, 2015 8:18 pm Post subject: |
|
|
Great! That means Clearwin is approaching 100% consistency allowing to dynamically update everything.
Please also take a look on dynamically updatable background color of controls %`bg, Paul, after finishing 64bit compiler ! This is extremely useful as a warning sign or a reminder to the user. Right now this requires page reload |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7934 Location: Salford, UK
|
Posted: Wed Feb 11, 2015 9:10 am Post subject: |
|
|
There is an existing rountine set_control_back_colour@ that may do the trick. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2828 Location: South Pole, Antarctica
|
Posted: Thu Feb 12, 2015 12:28 am Post subject: |
|
|
Yes, you are right, it exists, works, and i even tried it but not finished by some reason, thanks |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|