Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limiting selection of a checkbox in FP 2.6 styled code
Message
From
14/05/2007 22:59:57
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
14/05/2007 16:19:08
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01225372
Message ID:
01225430
Views:
22
>This is an old styled Foxpro checkbox. It is selected/deselected when the user clicks on it with the mouse, hits the spacebar or Enter when it has the focus. How can I restrict that to not include hitting the Enter key? Does changing the value of the Collect variable in the v_Collect procedure while trapping for the Enter key make sense? Seems a bit back-assward. Any ideas? Thanks!
>
>UPDATE: Ok, that doesn't really work because visually the checkboxes still check/uncheck. This @ SAY stuff really kinda blows to work with.
>
>
>**	'Turned Over for Collection'
>@ 19 * row_incr, 41 GET COLLECT ;
>	FUNCTION '*C ' + ALLTRIM( s1_prompt[ 22 ] ) ;
>	VALID v_collect() ;
>	COLOR ,,,,,,,,&control1_color,&disabl1_color
>
You can check the value of ReadKey() in v_collect. IIRC, it should be 13 (wrong, it's 15 - see below) if the exit key was Enter (but better check yourself, or ... here are some relevant scraps from my oooooold code:
#define def_okkeys 15, 271, 5, 261, 7, 263, 1, 257, 3, 259, 8, 264, 270

	Case Inlist(_u_readk, def_okkeys)
* enter (15+256) pgdn (7+256), ctrl+W (270), tab (5, 261)
Also, there was an extended set of values
Func u_rkext
para __rk          && passed by ref!
	_u_rkext=Readkey(1)

* 0 None of the following - zero if nothing happened 
	If _u_rkext > 1
		Do Case
* 6 READ timed out, __rk is 20 or 276
			Case Inlist(_u_rkext,6)
				__rk=20
* 5 DEACTIVATE clause returned .T., 6 READ timed out
			Case Inlist(_u_rkext,1,5)
				__rk=12

* 2 CLEAR READ issued
			Case _u_rkext=2
				__rk= 12

* 4 READ window closed
* 3 Terminating control chosen - enter implied
			Case Inlist(_u_rkext,3,4)
				__rk=15
		Endcase
	Endif (_u_rkext > 1)
retu _u_rkext
I don't exactly remember in which cases does it return regular value + 256... I figure you can always check just bitand(readkey(), 255).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform