forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dynamically updated %il and %sl

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Fri Aug 29, 2014 7:13 am    Post subject: Dynamically updated %il and %sl Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Aug 29, 2014 7:33 am    Post subject: Reply with quote

Thanks Dan. I have added this to the wish list.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Aug 29, 2014 7:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sat Aug 30, 2014 6:30 am    Post subject: Reply with quote

Thanks Eddie.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Sun Aug 31, 2014 1:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Feb 10, 2015 1:31 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Feb 10, 2015 5:05 pm    Post subject: Reply with quote

Brilliant!

And can we have the case of both limits being identical making the control read only please?

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Feb 10, 2015 5:41 pm    Post subject: Reply with quote

OK. This has now been added to set_integer_limits@.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Tue Feb 10, 2015 8:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Feb 11, 2015 9:10 am    Post subject: Reply with quote

There is an existing rountine set_control_back_colour@ that may do the trick.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Thu Feb 12, 2015 12:28 am    Post subject: Reply with quote

Yes, you are right, it exists, works, and i even tried it but not finished by some reason, thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Suggestions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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