TDBEdit.MaxLength resets to 0 in IDE when i close the TSQLQuery (design time)
Original Reporter info from Mantis: eara
-
Reporter name: Stratis Aravias
Original Reporter info from Mantis: eara
- Reporter name: Stratis Aravias
Description:
in dbedit.inc near line 48 in my version
44: else begin
45: if not FCustomEditMask then
46: EditMask := '';
47: Text := '';
48: MaxLength := 0; // <-- This line (can be deleted?)
49: end;
resets the MaxLength to zero. So, if this is "normal" why you put it in Object Inspector?
I try to handle the situation where all my TStringFields from db are returned with size x 3! and all the TDBEDit are also set to maxLength x 3. If i try to change them from IDE then when i close the query (in design) maxlength resets to zero.
If you look above these lines
40: if (DataLinkField.DataType in [ftString, ftFixedChar, ftWidestring, ftFixedWideChar])
41: and (MaxLength = 0) then
42: MaxLength := DatalinkField.Size;
here you don't touch MaxLength if it is not zero (because the developer set it to some "desired" value).
I think the same should also be done in line 48 and leave the MaxLength untouched (by removing line 48 from code)
otherwise MaxLength is only for informational purposes in the Object Inspector that has no meaning to touch it (=junk) ...
(i lost many hours with setting this damned property for every TDBEdit in my project and then "pouffff" all 0).
Plz, confirm it
thank you
Mantis conversion info:
- Mantis ID: 26052
- OS: windows 7
- OS Build: 32bits
- Build: lazarus 1.2.0/FPC 2.6.2
- Platform: windows
- Version: 1.2.0
- Monitored by: » luizamerico (Luiz Americo)