|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
simon
Joined: 05 Jul 2006 Posts: 268
|
Posted: Fri Jun 20, 2008 2:32 pm Post subject: Issue with %co[check_on_focus_loss] |
|
|
The simple program below prompts for a number, and then prints this out when one selects the Test menu button. With %co[check_on_focus_loss] it is impossible to change the number. However, I have applications similar to this in which I need to use check_on_focus_loss to prevent invalid entries, and want the user to be able to then go to a menu item (or use an accelerator key). Surely activating a menu item represents a loss of focus.
Code: | MODULE m
INTEGER, PUBLIC :: n=1
END MODULE m
!
WINAPP
PROGRAM p1
USE m
IMPLICIT NONE
INTEGER :: iw
INTEGER, EXTERNAL :: f
!
iw=winio@('%mn[Test]&',f)
iw=winio@('%co[check_on_focus_loss]Input: %dd%5rd',1,n)
END PROGRAM p1
!
FUNCTION f()
USE m
IMPLICIT NONE
INTEGER :: f
WRITE (UNIT=*,FMT=*) n
f=1
END FUNCTION f |
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Jun 20, 2008 8:15 pm Post subject: |
|
|
It seems that a menu is not a control in the sense of triggering focus loss checks. Your code works as expected with a %^bt. It also works if you remove the %co.
Since you don't have %il, then any value is OK in the %rd box, so why only check at the end?
Eddie |
|
Back to top |
|
|
simon
Joined: 05 Jul 2006 Posts: 268
|
Posted: Fri Jun 20, 2008 8:57 pm Post subject: |
|
|
Thanks for the reply. In my original program I do have a %il for a lower bound, so that the code for forming the window is something like:
Code: | iw=winio@('%mn[Test]&')
iw=winio@('%il&',4,HUGE(n))
iw=winio@('%co[check_on_focus_loss]Input: %dd%5rd',1,n) |
(n must, of course, be initialised in the module to a valid value).
I don't want to use %co[full_check], which is the default, since this makes it painful for the user to type in values between 10 and 39. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Jun 20, 2008 9:08 pm Post subject: |
|
|
Hi Simon,
I have big issues with %il and %fl, partly because they are not "dynamic", i.e. they respond to the initial values given, and also they don't work for lower_limit=upper_limit, i.e. the value can't change, and they need to be explicitly turned off. As a result, I have gone through my code eliminating most of them, and find it far more satisfactory to do the range check myself in a call-back function.
I often find that Clearwin has superb facilities that I never dreamt that I would use, and am likely to only use once anyway - but every now and again it comes up with limitation like yours.
I suspect that exiting a window by means of a menu item is "unconventional Windows", and that no-one ever thought to allow it, because they assumed one would exit with an "OK" button or the like.
Eddie |
|
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
|