I have a textbox which I use to enter money. ControlSource is a property on the form. I initialise it to 0000.00 in the form's Init. If the user tabs into the textbox it is highlighted and any amount can be entered but if they click into the box too close to the right hand edge it will only allow a small amount to be entered. Is there a setting which will cause the box to be highlighted when clicked in the same way as tabbed? I'm sure I've seen one but can't find it.
Thanks
John
John Weller 01380 723235 07976 393631
KEYBOARD {Ctrl+A} in GotFocus, IIRC.
On Wed, Nov 8, 2017 at 1:26 PM, John Weller john@johnweller.co.uk wrote:
I have a textbox which I use to enter money. ControlSource is a property on the form. I initialise it to 0000.00 in the form's Init. If the user tabs into the textbox it is highlighted and any amount can be entered but if they click into the box too close to the right hand edge it will only allow a small amount to be entered. Is there a setting which will cause the box to be highlighted when clicked in the same way as tabbed? I'm sure I've seen one but can't find it.
Thanks
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
And what if the user is trying to highlight some specific part of the number? By automagically applying the select all to mouse clicks, you make that more difficult to do. Having said that, I've also got similar issues with users clicking into a number box and not going as far left as they can.
I also think that there might be something in either Kilofox or Megafox; the Hentzenwerke books written by the late Marcia Akins, Andy Kramek and Rick Schummer.
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Wednesday, November 08, 2017 2:01 PM To: profoxtech@leafe.com Subject: Re: Textbox Highlighting
KEYBOARD {Ctrl+A} in GotFocus, IIRC.
On Wed, Nov 8, 2017 at 1:26 PM, John Weller john@johnweller.co.uk wrote:
I have a textbox which I use to enter money. ControlSource is a property on the form. I initialise it to 0000.00 in the form's Init. If the user tabs into the textbox it is highlighted and any amount can be entered but if they click into the box too close to the right hand edge it will only allow a small amount to be entered. Is there a setting which will cause the box to be highlighted when clicked in the same way as tabbed? I'm sure I've seen one but can't find it.
Thanks
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
And Ctrl-A has more problems: if the box is blank, f'example.
The property is SelectOnEntry.
On Wed, Nov 8, 2017 at 2:10 PM, Richard Kaye rkaye@invaluable.com wrote:
And what if the user is trying to highlight some specific part of the number? By automagically applying the select all to mouse clicks, you make that more difficult to do. Having said that, I've also got similar issues with users clicking into a number box and not going as far left as they can.
I also think that there might be something in either Kilofox or Megafox; the Hentzenwerke books written by the late Marcia Akins, Andy Kramek and Rick Schummer.
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Wednesday, November 08, 2017 2:01 PM To: profoxtech@leafe.com Subject: Re: Textbox Highlighting
KEYBOARD {Ctrl+A} in GotFocus, IIRC.
On Wed, Nov 8, 2017 at 1:26 PM, John Weller john@johnweller.co.uk wrote:
I have a textbox which I use to enter money. ControlSource is a property on the form. I initialise it to 0000.00 in the form's Init. If the user tabs into the textbox it is highlighted and any amount can be entered but if they click into the box too close to the right hand edge it will only allow a small amount to be entered. Is there a setting which will cause the box to be highlighted when clicked in the same way as tabbed? I'm sure I've seen one but can't find it.
Thanks
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
No, that's not exactly right, either... SelectOnEntry (and the old '@K' option in Format/InputMask, @GET and TRANSFORM) apply to keyboarding and not mousing.
The "box is blank" issue applies to keyboarding when you're trying to do something tricky like put the cursor at the beginning of the value, so that likely doesn't apply.
KEYBOARDing is an inelegant solution: it depends on the Edit menu being available the default Ctrl+A menu shortcut defined.
On Wed, Nov 8, 2017 at 2:22 PM, Ted Roche tedroche@gmail.com wrote:
And Ctrl-A has more problems: if the box is blank, f'example.
The property is SelectOnEntry.
On Wed, Nov 8, 2017 at 2:10 PM, Richard Kaye rkaye@invaluable.com wrote:
And what if the user is trying to highlight some specific part of the number? By automagically applying the select all to mouse clicks, you make that more difficult to do. Having said that, I've also got similar issues with users clicking into a number box and not going as far left as they can.
I also think that there might be something in either Kilofox or Megafox; the Hentzenwerke books written by the late Marcia Akins, Andy Kramek and Rick Schummer.
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Wednesday, November 08, 2017 2:01 PM To: profoxtech@leafe.com Subject: Re: Textbox Highlighting
KEYBOARD {Ctrl+A} in GotFocus, IIRC.
On Wed, Nov 8, 2017 at 1:26 PM, John Weller john@johnweller.co.uk wrote:
I have a textbox which I use to enter money. ControlSource is a property on the form. I initialise it to 0000.00 in the form's Init. If the user tabs into the textbox it is highlighted and any amount can be entered but if they click into the box too close to the right hand edge it will only allow a small amount to be entered. Is there a setting which will cause the box to be highlighted when clicked in the same way as tabbed? I'm sure I've seen one but can't find it.
Thanks
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
I s'spose if you wanted to avoid the menu dependence, you could set some of the Sel* properties, try this (untested) code:
GetFocus(): THIS.SelStart=1 THIS.SelLength = LEN(THIS.Value)
(Of course, if THIS.Value isn't a string, you'll need to use ALLTRIM(STRING(THIS.Value)) or other functions as appropriate)
(OK, I really need to stop fooling around and get back to writing HTML :)...
On Wed, Nov 8, 2017 at 2:33 PM, Ted Roche tedroche@gmail.com wrote:
No, that's not exactly right, either... SelectOnEntry (and the old '@K' option in Format/InputMask, @GET and TRANSFORM) apply to keyboarding and not mousing.
The "box is blank" issue applies to keyboarding when you're trying to do something tricky like put the cursor at the beginning of the value, so that likely doesn't apply.
KEYBOARDing is an inelegant solution: it depends on the Edit menu being available the default Ctrl+A menu shortcut defined.
On Wed, Nov 8, 2017 at 2:22 PM, Ted Roche tedroche@gmail.com wrote:
And Ctrl-A has more problems: if the box is blank, f'example.
The property is SelectOnEntry.
On Wed, Nov 8, 2017 at 2:10 PM, Richard Kaye rkaye@invaluable.com wrote:
And what if the user is trying to highlight some specific part of the number? By automagically applying the select all to mouse clicks, you make that more difficult to do. Having said that, I've also got similar issues with users clicking into a number box and not going as far left as they can.
I also think that there might be something in either Kilofox or Megafox; the Hentzenwerke books written by the late Marcia Akins, Andy Kramek and Rick Schummer.
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Wednesday, November 08, 2017 2:01 PM To: profoxtech@leafe.com Subject: Re: Textbox Highlighting
KEYBOARD {Ctrl+A} in GotFocus, IIRC.
On Wed, Nov 8, 2017 at 1:26 PM, John Weller john@johnweller.co.uk wrote:
I have a textbox which I use to enter money. ControlSource is a property on the form. I initialise it to 0000.00 in the form's Init. If the user tabs into the textbox it is highlighted and any amount can be entered but if they click into the box too close to the right hand edge it will only allow a small amount to be entered. Is there a setting which will cause the box to be highlighted when clicked in the same way as tabbed? I'm sure I've seen one but can't find it.
Thanks
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
On 11/8/2017 3:25 PM, Ted Roche wrote:
[snip]
KEYBOARDing is an inelegant solution: it depends on the Edit menu being available the default Ctrl+A menu shortcut defined.
Just a quick aside, the Keyboard stuffing of Ctrl+A does not require the edit menu to be available, nor shortcut be defined. I think that holds true for all the KEYBOARD "labels" that VFP defines.
-Charlie
I did it with both the textbox settings, and using the GotFocus, LostFocus, and MouseUp events.
The class gets a new property IsActive = .F.
GotFocus: IF NOT MDOWN() THIS.IsActive = .T. ENDIF
MouseUp: IF NOT THIS.IsActive and THIS.SelLength = 0 THIS.SelStart = 0 THIS.SetLength = LEN(RTRIM(THIS.Text)) ENDIF THIS.IsActive = .T.
LostFocus: THIS.SelStart = 0 THIS.IsActive = .F.
If a user clicks into and highlights a portion of the text. I leave it selected.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Charlie-gm Sent: Wednesday, November 08, 2017 3:41 PM To: profoxtech@leafe.com Subject: Re: Textbox Highlighting
On 11/8/2017 3:25 PM, Ted Roche wrote:
[snip]
KEYBOARDing is an inelegant solution: it depends on the Edit menu being available the default Ctrl+A menu shortcut defined.
Just a quick aside, the Keyboard stuffing of Ctrl+A does not require the edit menu to be available, nor shortcut be defined. I think that holds true for all the KEYBOARD "labels" that VFP defines.
-Charlie
[excessive quoting removed by server]
On Wed, Nov 8, 2017 at 3:40 PM, Charlie-gm ccbibleman@gmail.com wrote:
Just a quick aside, the Keyboard stuffing of Ctrl+A does not require the edit menu to be available, nor shortcut be defined. I think that holds true for all the KEYBOARD "labels" that VFP defines.
-Charlie
I did not know that. Cool!
P.S. We beat this topic to death right here on the forum, only 16 years ago: https://leafe.com/archives/full_thread/45436
P.P.S. Thanks again, Ed, for the great archives!
Some of those names are a real blast from the past :-)
John Weller 01380 723235 07976 393631
P.S. We beat this topic to death right here on the forum, only 16 years
ago:
https://leafe.com/archives/full_thread/45436
P.P.S. Thanks again, Ed, for the great archives!
Do I win a prize for starting that thread? Wow...that is a blast from the past! That was about 5 jobs ago!
On 2017-11-08 17:03, John Weller wrote:
Some of those names are a real blast from the past :-)
John Weller 01380 723235 07976 393631
P.S. We beat this topic to death right here on the forum, only 16 years
ago:
https://leafe.com/archives/full_thread/45436
P.P.S. Thanks again, Ed, for the great archives!
And always gratifying when a smart guy like Paul McNett agrees with me about user hostile interfaces... š
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of John Weller Sent: Wednesday, November 08, 2017 5:04 PM To: profoxtech@leafe.com Subject: RE: Textbox Highlighting
Some of those names are a real blast from the past :-)
John Weller 01380 723235 07976 393631
P.S. We beat this topic to death right here on the forum, only 16 years
ago:
https://leafe.com/archives/full_thread/45436
P.P.S. Thanks again, Ed, for the great archives!
"(OK, I really need to stop fooling around and get back to writing
__________."
This is a hazard to all members of the ProFox mail list. I find myself wanting to chase all of the weird and wonderful stuff I see here and then I remember that the light bill is due next week and my employees always seem to want a paycheck on Friday.
Can't they just let me PLAY!?
Paul
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Wednesday, November 08, 2017 2:25 PM To: profoxtech@leafe.com Subject: Re: Textbox Highlighting
I s'spose if you wanted to avoid the menu dependence, you could set some of the Sel* properties, try this (untested) code:
GetFocus(): THIS.SelStart=1 THIS.SelLength = LEN(THIS.Value)
(Of course, if THIS.Value isn't a string, you'll need to use ALLTRIM(STRING(THIS.Value)) or other functions as appropriate)
(OK, I really need to stop fooling around and get back to writing HTML :)...
On Wed, Nov 8, 2017 at 2:33 PM, Ted Roche tedroche@gmail.com wrote:
No, that's not exactly right, either... SelectOnEntry (and the old '@K' option in Format/InputMask, @GET and TRANSFORM) apply to keyboarding and not mousing.
The "box is blank" issue applies to keyboarding when you're trying to do something tricky like put the cursor at the beginning of the value, so that likely doesn't apply.
KEYBOARDing is an inelegant solution: it depends on the Edit menu being available the default Ctrl+A menu shortcut defined.
On Wed, Nov 8, 2017 at 2:22 PM, Ted Roche tedroche@gmail.com wrote:
And Ctrl-A has more problems: if the box is blank, f'example.
The property is SelectOnEntry.
On Wed, Nov 8, 2017 at 2:10 PM, Richard Kaye rkaye@invaluable.com
wrote:
And what if the user is trying to highlight some specific part of the
number? By automagically applying the select all to mouse clicks, you make that more difficult to do. Having said that, I've also got similar issues with users clicking into a number box and not going as far left as they can.
I also think that there might be something in either Kilofox or Megafox;
the Hentzenwerke books written by the late Marcia Akins, Andy Kramek and Rick Schummer.
--
rk
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Wednesday, November 08, 2017 2:01 PM To: profoxtech@leafe.com Subject: Re: Textbox Highlighting
KEYBOARD {Ctrl+A} in GotFocus, IIRC.
On Wed, Nov 8, 2017 at 1:26 PM, John Weller john@johnweller.co.uk
wrote:
I have a textbox which I use to enter money. ControlSource is a property on the form. I initialise it to 0000.00 in the form's Init. If the user tabs into the textbox it is highlighted and any amount can be entered but if they click into the box too close to the right hand edge it will only allow a small amount to be entered. Is there a setting which will cause the box to be highlighted when clicked in the same way as tabbed? I'm sure I've seen
one but can't find it.
Thanks
John
John Weller 01380 723235 07976 393631
[excessive quoting removed by server]
They sound as much as a nuisance as users - life would be so much easier without them :-)
John Weller 01380 723235 079763 93631 Sent from my iPad
On 8 Nov 2017, at 22:57, Paul H. Tarver paul@tpcqpc.com wrote:
"(OK, I really need to stop fooling around and get back to writing
__________."
This is a hazard to all members of the ProFox mail list. I find myself wanting to chase all of the weird and wonderful stuff I see here and then I remember that the light bill is due next week and my employees always seem to want a paycheck on Friday.
Can't they just let me PLAY!?
On Wed, Nov 8, 2017 at 2:10 PM, Richard Kaye rkaye@invaluable.com wrote:
And what if the user is trying to highlight some specific part of the number? By automagically applying the select all to mouse clicks, you make that more difficult to do. Having said that, I've also got similar issues with users clicking into a number box and not going as far left as they can.
Ah, but it doesn't apply to all mouseclicks, I didn't put it in Click(), but in GotFocus(). It should fire on the first click, but later clicks should have no effect, allowing you to highlight or position the cursor.
The "far left" issue is trickier, iirc. I think there was a key combination to set the cursor to the left, but would backtab to the previous control if the current control was empty.
Thanks Ted, that works well - once I translated the Help file into English English :-) (There was some confusion over which brackets were braces)
Regards
John
John Weller 01380 723235 07976 393631
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: 08 November 2017 19:01 To: profoxtech@leafe.com Subject: Re: Textbox Highlighting
KEYBOARD {Ctrl+A} in GotFocus, IIRC.