Forum > Designer

Maskedit usage problems

<< < (2/3) > >>

szlbz:
Hello  Bart,由于是设计时的显示Bug,debug不了IDE Bug,不过发现是MaskEdit.pp的function TCustomMaskEdit.ClearChar(Position : Integer) : TUtf8Char;
Because it is a design time display bug, the IDE bug cannot be debugged, but it is found in maskedit Function tcustommaskedit Clearchar (position: integer): tutf8char;

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function TCustomMaskEdit.ClearChar(Position : Integer) : TUtf8Char;begin  //For Delphi compatibilty, only literals remain, all others will be blanked  case GetMask(Position).MaskType Of    {Char_Space               : Result := #32; //FSpaceChar?; //not Delphi compatible, see notes above}    Char_HourSeparator        : Result := DefaultFormatSettings.TimeSeparator;//<---     Char_DateSeparator        : Result := DefaultFormatSettings.DateSeparator;//<----    Char_IsLiteral            : Result := FMask[Position].Literal; //No need to use GetMask, FMask[Position] already has been validated    otherwise      Result := FSpaceChar;  end;end;  modi:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    Char_HourSeparator        : Result := ':';//DefaultFormatSettings.TimeSeparator;     Char_DateSeparator        : Result := '/';//DefaultFormatSettings.DateSeparator; 然后重新编译lazarus,设计时显示就正常了,不清楚为什么设计时DefaultFormatSettings.DateSeparator为什么会出现问题。
Then recompile Lazarus, and the design time display will be normal. It is not clear why there are problems in the design time.
thanks!

Bart:
That is not a fix but a workaround for your specific problem.
As by desing '/' and ':' have special meaning in TMaskEdit and must be replaced with DateSeparator and TimeSeparator respectively in the text.

The IDE can be debugged as wel: open the lazarus.lpi project in Lazarus, build and run it.
(OK, sounds easy, but it's really not that simple).

As asked before: please file a bugreport in the bugtracker.

Bart

szlbz:
yes,That is not a fix。

szlbz:
IDE debugging is difficult. I use another method to temporarily solve my problem. Open ide/lazarus.pp, add 2 lines
ide调试有难度,采用另一种方法暂时解决我的问题,打开ide/lazarus.pp, 添加2行

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$I revision.inc}{$R lazarus.res}{$R ../images/laz_images.res} begin  Max_Frame_Dump:=32; // the default 8 is not enough  DefaultFormatSettings.DateSeparator:='-';//2022.6.1  修复mask字符串包含/:时乱码的Bug  DefaultFormatSettings.TimeSeparator:=':';//2022.6.1  修复mask字符串包含/:时乱码的Bug 

Bart:
Again: please open a ticket in the bugtracker.
Then at least somebody familiar with the IDE and the widgetset involved can have a look at it.
It's your only chace of getting this fixed properly.

Bart

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version