MaskEdit is jumpy lazarus / 31-LCL ---------------------------------------------------------------------- Middlecope · 2018-09-20 14:03 OS Linux OpenSuse Lepa 15 Lazarus 1.8.2 FPC 3.0.4 Widget Type gtk2 Mask 99-99-99;1;_ After the last update to 1.8.2 The MaskEdit is very difficult to fill. I should be very slow and wait otherwise the position of the cursor will jump 1 position. Before I did not have that problem! Any idea what can be wrong? Thanks Teunis ---------------------------------------------------------------------- Bart · 2018-09-20 17:18 No serious changes to TMaskEdit have occurred in the last months. Maybe widgetset related? If you build for QT, do you have the same problem? Bart ---------------------------------------------------------------------- Middlecope · 2018-09-20 18:40 I rebuild the LazarusIDE with  Quty. And it gives the same result. Even in properties (F11) of MaskEdit1 If I tryout the mask it is jumpy. Should I change the mask? I am using it for date entry (dd-mm-yy) Thakns for your attention! Teunis ---------------------------------------------------------------------- Bart · 2018-09-20 20:58 On Windows it behaves OK (tested only Lazarus trunk). B.t.w: you might want to chang the EditMask '99-99-99;1;_' into '99/99/99;1;_' The slash '/' will be automatically replaced with the systems date- separator. It will not have any influence on the proble you desribed though. Bart ---------------------------------------------------------------------- Middlecope · 2018-09-21 15:04 I did a new install from SourceForge. on a different computer Opensuse Leap 15 Pascal 1.8.4 FPC 3.0.4 Still the same problem. If I enter a numbers quickly the cursor moves 2 positions instead of 1 How can I debug the problem? Strange am I the only one that has this problem? Teunis ---------------------------------------------------------------------- Bart · 2018-09-21 16:15 I tested Lazarus trunk on Linux Mint 18.2, both GTK2 and QT: no issues. I can type as quick as I want, no "jumpyness". Maybe attach an OnKeyDown event and see if the Key there is what you expect? The "cursor" by design only advances when you type a character or use the arrow keys. The moving of the cursor happens in SelectNextChar and SelectPrevChar. Put some debugln statements there (and/or in InsertChar) to monitor what you want. Using the debugger to step won't do any good, since this will force you to type "slow". Bart ---------------------------------------------------------------------- Middlecope · 2018-09-21 18:38 I added a simple OnKeyDown event: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm8.MaskEdit1KeyDown(Sender: TObject; var Key: Word;  Shift: TShiftState);begin  Label6.Caption:= Label6.Caption + Char(Key);end;Now typing the date is much better. I will keep the KeyDown event.  Shall I keep it in my code and add Label6.Visible:= FALSE ???? Teunis Tomorrow I will continue this issue ---------------------------------------------------------------------- Middlecope · 2018-09-22 14:14 The KeyDown event is not a solution. Where can I find the MaskEdit unit? Maybe I can do some debugging. Where can I download older versions of Lazarus and fpcsrc? Maybe I can give it a try with this older version of the MaskEdit unit Yours Teunis ---------------------------------------------------------------------- valdir.marcos · 2018-09-22 14:25 Quote from: Middlecope on September 22, 2018, 04:14:37 pmWhere can I find the MaskEdit unit? Maybe I can do some debugging.Windows: C:\lazarus\lcl\maskedit.pp QuoteWhere can I download older versions of Lazarus and fpcsrc? Maybe I can give it a try with this older version of the MaskEdit unithttps://freepascal.org/download.var https://freepascal.org/down/old/down.var https://sourceforge.net/projects/lazarus/files/ ---------------------------------------------------------------------- Bart · 2018-09-22 14:56 In the IDE Ctrl+Click on MaskEdit (in your uses clause), that will open the maskedit unit for you. Bart ---------------------------------------------------------------------- Middlecope · 2018-09-23 13:34 I still have to look at the older versions. To show how serious the problem is I attach a screenshot. Upper left you see the the numbers, that I entered in the MaskEdit1.Text. And you see the maskedit. In the preview I can't see the attached jpg (5.5 KB) I will continue because I need MaskEdit for my accounting program Teunis ---------------------------------------------------------------------- Bart · 2018-09-23 14:35 Can you try with trunk? Bart ---------------------------------------------------------------------- Middlecope · 2018-09-24 02:00 Yes Bart, I will (can) do. For me it is a problem that needs to be resolved. I will continue in this threat. (topic) Teunis on monday I will give it a try ---------------------------------------------------------------------- Middlecope · 2018-09-27 19:01 It took some time.  I build lazarus  2.1.0  SVN 59171. That did not help still the same problem. Strange,  that I am the only one having that problem.  (Slow typing is OK Quick typing jumpy) For example quick typing 123456 -> 1_-3_-5_  slow typing 123456 -> 12-34-56 If there is no solution then I will (have to)  make my own object TDatumEdit that will work for my programs. Thanks for your attention, Teunis ---------------------------------------------------------------------- Bart · 2018-09-28 12:10 TDateEdit does not work for you? Bart ---------------------------------------------------------------------- Middlecope · 2018-09-28 15:30 I did not know of the the existence of TDateEdit.  Yes ithat works well. I added a KeyUp event to make sure only numbers are entered: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm8.DateEdit1KeyUp(Sender: TObject; var Key: Word;  Shift: TShiftState);begin// excluding the entry of date separators "-" and "/"IF Key IN [189,191] THEN BEGINDateEdit1.Text:= Copy(DateEdit1.Text,1,Length(DateEdit1.Text)-1);DateEdit1.Selstart:= Length(DateEdit1.Text) END;//placing the date separator "-"  IF (Length(DateEdit1.Text) IN [2,5]) THEN BEGIN     DateEdit1.Text:= DateEdit1.Text + '-';DateEdit1.SelStart:= Length(DateEdit1.Text) +1 END;end; Thanks for the advice and for me the topic is solved, Teunis