How to limit de lenght of edited text in a Grid.
Moderator: Rathinagiri
How to limit de lenght of edited text in a Grid.
When using a grid i use:
ColumnControls {aControlDef1,aControlDef2,...aControlDefN}
For a text TEXTBOX
{ cControlType , cDataType , cInputMask , cFormat }
cControlType = 'TEXTBOX' (Required)
cDataType = 'CHARACTER' , 'NUMERIC' , 'DATE' (Required)
cInputMask = cInputMask (Optional)
cFormat = cFormat (Optional)
For example I can use:
{'TEXTBOX','CHARACTER','AAAAAA'}
Now the length edited text is limited to 5 positions but i cannot enter numbers.
{'TEXTBOX','CHARACTER','!!!!!!'}
Now the length edited text is limited to 5 positions, i can enter numbers but all lower case characters are converted to uppercase.
I need something like the old 'X' picture string in Clipper
{'TEXTBOX','CHARACTER','XXXXXX'}
http://www.itlnet.net/programming/progr ... aee8c.html
Like the 'A' inputmask but including numbers.
Or is there another way to limit the lenght of the typed text (like MAXLENGTH in a TEXTBOX)
Or is there another way to do this ?
Theo
ColumnControls {aControlDef1,aControlDef2,...aControlDefN}
For a text TEXTBOX
{ cControlType , cDataType , cInputMask , cFormat }
cControlType = 'TEXTBOX' (Required)
cDataType = 'CHARACTER' , 'NUMERIC' , 'DATE' (Required)
cInputMask = cInputMask (Optional)
cFormat = cFormat (Optional)
For example I can use:
{'TEXTBOX','CHARACTER','AAAAAA'}
Now the length edited text is limited to 5 positions but i cannot enter numbers.
{'TEXTBOX','CHARACTER','!!!!!!'}
Now the length edited text is limited to 5 positions, i can enter numbers but all lower case characters are converted to uppercase.
I need something like the old 'X' picture string in Clipper
{'TEXTBOX','CHARACTER','XXXXXX'}
http://www.itlnet.net/programming/progr ... aee8c.html
Like the 'A' inputmask but including numbers.
Or is there another way to limit the lenght of the typed text (like MAXLENGTH in a TEXTBOX)
Or is there another way to do this ?
Theo
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
How to limit de lenght of edited text in a Grid.
Yes Theo, I think you are right.
It would be nice to have this extra property in the TextBox as optional too.
By this logic:
1. You need to accept alpha and numbers what you would define as character type.
2. Then it can not contain any mask. It has to be free.
3. It remains to limit the typing field. For what would be missing the clause: MAXLENGTH
It would have to be implemented in the _HMG_PARSEGRIDCONTROLS and _HMG_GRIDINPLACEEDIT functions at EDITCONTROLS and CI located at h_grid.prg file.
I believe one difficulty is to avoid when Inputmask and Maxlength clauses.
It can't be used simultaneously. (TextBox/HMGDoc)
Remarks:
IMHO, this your message/topic could be moved to HMG Wishlist as your request and proposal to implementation.
It would be nice to have this extra property in the TextBox as optional too.
By this logic:
1. You need to accept alpha and numbers what you would define as character type.
2. Then it can not contain any mask. It has to be free.
3. It remains to limit the typing field. For what would be missing the clause: MAXLENGTH
It would have to be implemented in the _HMG_PARSEGRIDCONTROLS and _HMG_GRIDINPLACEEDIT functions at EDITCONTROLS and CI located at h_grid.prg file.
I believe one difficulty is to avoid when Inputmask and Maxlength clauses.
It can't be used simultaneously. (TextBox/HMGDoc)
Remarks:
You want to say 6 positions instead of 5.
I think it can not be "X" because it deals with the numeric type (according to instructions):
"X" = N => Displays DB after negative numbers
IMHO, this your message/topic could be moved to HMG Wishlist as your request and proposal to implementation.
Last edited by Pablo César on Fri Feb 03, 2017 10:40 am, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
How to limit de lenght of edited text in a Grid.
Hello Theo, I've been able to do what you need.
To let us for adding one more parameter (optional) to the TextBox in the Grid for MAXLENGTH)
Change in source h_grid.prg is required as I said earlier. It is up to the HMG development team to approve or not to become a permanent part of HMG in the future.
The change does not imply any change with the operation of the TextBox in the Grid and maintains the backward compatibility.
The only limitation that Inputmask and Maxlength is not be placed simultaneously. In the implemented code, there is no verification on this issue. The programmer has to keep that in mind, otherwise MAXLENGTH simply will not work.
Here's the source file to replace and rebuild the library through BuildLib32.bat:
The usage syntax is: {'TEXTBOX','CHARACTER',,,5}
Hereunder a SAMPLES Demo:
The fifth parameter is optional and is the value in number of characters that will be accepted as is done in the MAXLENGTH property of the normal TextBox.
I hope the change is satisfactory and can be enjoyed by all on a permanent basis.
@ Claudio. All changes I've made are identified with: // Pablo on February, 2017
To let us for adding one more parameter (optional) to the TextBox in the Grid for MAXLENGTH)
Change in source h_grid.prg is required as I said earlier. It is up to the HMG development team to approve or not to become a permanent part of HMG in the future.
The change does not imply any change with the operation of the TextBox in the Grid and maintains the backward compatibility.
The only limitation that Inputmask and Maxlength is not be placed simultaneously. In the implemented code, there is no verification on this issue. The programmer has to keep that in mind, otherwise MAXLENGTH simply will not work.
Here's the source file to replace and rebuild the library through BuildLib32.bat:
The usage syntax is: {'TEXTBOX','CHARACTER',,,5}
Hereunder a SAMPLES Demo:
I hope the change is satisfactory and can be enjoyed by all on a permanent basis.
@ Claudio. All changes I've made are identified with: // Pablo on February, 2017
Last edited by Pablo César on Fri Feb 03, 2017 2:29 pm, edited 9 times in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
How to limit de lenght of edited text in a Grid.
+1your request and proposal to implementation
Please Theo, kindly ask to Rathinagiri to move the topic. Its more appropriated.IMHO, this your message/topic could be moved to HMG Wishlist as your request and proposal to implementation.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
How to limit de lenght of edited text in a Grid.
Claudio, aqui en adjunto una pequeña alteracion agregando esa nueva propiedad en el Grid y con ejemplo para el HMGDoc.
<DOC file was removed because typo were found and been corrected at message ahead of this topic.>
<DOC file was removed because typo were found and been corrected at message ahead of this topic.>
Last edited by Pablo César on Sat Feb 04, 2017 11:58 am, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: How to limit de lenght of edited text in a Grid.
Wow Pablo !!
Amazing, this is exactly what i needed
You made my day.
Many thanks my friend !
Theo
Amazing, this is exactly what i needed
You made my day.
Many thanks my friend !
Theo
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: How to limit de lenght of edited text in a Grid.
You are welcome
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
- serge_girard
- Posts: 3167
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: How to limit de lenght of edited text in a Grid.
Great Pablo ! Thanks!
One detail: nMaxLenght should be nMaxLength
Serge
One detail: nMaxLenght should be nMaxLength
Serge
There's nothing you can do that can't be done...