[IT WORKED AROUND]Are not TBufDataset and TDBGrid good friends? lazarus / 16-Databases ---------------------------------------------------------------------- hrayon · 2017-02-21 12:03 See it: 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 TForm1.FormShow(Sender: TObject);var  l_integer_aux : integer;begin  BufDataset1.CreateDataSet;  BufDataset1ID1.ReadOnly:=false;   BufDataset1.Open;  BufDataset1.DisableControls;   for l_integer_aux := 1 to 20 do  begin    BufDataset1.Append;    BufDataset1ID1.AsInteger:=l_integer_aux;    BufDataset1.Post;  end;   BufDataset1ID1.ReadOnly:=true;  BufDataset1.EnableControls;end; After bottom border resizing, some values are replicated. The projet is attached too. Is there some workaround? I'd like to keep both working together. Typhon 6 FPC 3.1.1 Win 10 64 bits. Also tested with 32 bit Vista and the problem persists. ---------------------------------------------------------------------- Thaddy · 2017-02-21 12:11 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   BufDataset1.Open;  BufDataset1.DisableControls;/// hmmm. try this:  BufDataset1.DisableControls;  BufDataset1.Open; I would also suggest try/finally btw. But that is another matter. I tested with trunk from today on arm-linux: no issues. Note that i think you think you are using trunk, but CodeThyphon is unsupported and lags big-time with the real trunk. CodeTyphon is OK, mind you ((for some), but CodeTypon's "trunk" isn't trunk. And in principle it is not supported on this forum. Because it causes confusion with the real deal. And because they don't document AT ALL what's in their releases and based on what. I would recommend a CodeTyphon release based on FPC stable and NOT use their "trunk". If you are an advanced user, use the real trunk. (CodeTyphon is hard to get rid off, even on my birthday, today  I wish they had more sense, then it would be even good!) ---------------------------------------------------------------------- hrayon · 2017-02-21 12:39 Thank you Thaddy. After reading your comment, I made the change in the code, and the error persists. I also installed Lazarus 1.6.2 (lazarus-1.6.2-fpc-3.0.0-win64.exe) from SourceForge. But ... the error still persists. ---------------------------------------------------------------------- Thaddy · 2017-02-21 13:00 There have been a good many changes to TBufDataset in trunk and most of them have been back-ported to 3.0.2 which I used. Not 3.0.0. But I guess there can also be an issue just with the TDbGrid in Laz 1.6.2... I was using LazTrunk (1.7) from today. Do not install that (1.7) if you do not need it, but do install the official FPC 3.0.2. Maybe Lacak can help out if he reads this... or one of the Laz developers? ---------------------------------------------------------------------- hrayon · 2017-02-21 13:08 I'm confused when I see the code of the components, without a documentation in the code I'm lost ... does the hack that exists in the DBGrid code that signals the binary search for the case of BufDataSet has to do with this? Search for the word "TBufDataset" in the code "dbgrids.pas" and see. I can get the informed versions with fpcupdeluxe, right? I'll try. ---------------------------------------------------------------------- hrayon · 2017-02-21 13:25 While checkout is being done ... I do not know if I understand you very well, but is it your birthday today? If I'm right, happy birthday! And for your number of posts, I and many of us must thank you! (sorry my english) ---------------------------------------------------------------------- Thaddy · 2017-02-21 13:43 tnx    59... Number of posts doesn't count, about 20% was useful and accurate. About 5% without offending people by accident ---------------------------------------------------------------------- hrayon · 2017-02-21 14:48 Bad news... Laz 1.6.2 and FPC 3.0.2: problem persists  When trying Laz 1.7 got error in fpcupdeluxe. It will be good if someone else can test if the problem persists in other environments. The problem only appears if there are records covered by the bottom edge of the form. If you do not see the problem, try to "shake" the edge of the bottom form when you're resizing it. Maximizing the window does not show the problem even if the scroll bar is used. Only if the window is resized (bottom) with the mouse. I used CodeTyphon just because it was easier to get started with several components installed, and I agree that what they do with licensing is weird. I also hope they improve that part, I do not feel safe using it in that regard. I am waiting for the completion of the "Online Package Manager", looks promising. If it were integrated with Lazarus, along with fpcupdeluxe, it would be even better! It's always good to click less and write less to get things working. Number of posts do count. Thank you again! ---------------------------------------------------------------------- jacmoe · 2017-02-21 14:53 Could you try Fpcupdeluxe with the "Fixes" button? It will give you 1.6.3/3.0.3. And, you can install the Online Package Manager. Simply run 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 svn co http ://svn.freepascal.org/svn/lazarus/trunk/components/onlinepackagemanage r onlinepackagemanagerin the fpcupdeluxe/lazarus/components directory - see the OPM thread topic - I managed to do that for 'Fixes'. ---------------------------------------------------------------------- howardpc · 2017-02-21 15:06 Quote from: hrayon on February 21, 2017, 03:48:57 pmBad news... Laz 1.6.2 and FPC 3.0.2: problem persists  It will be good if someone else can test if the problem persists in other environments. On Linux with 1.6.2/3.0.0 there is no display problem at all when resizing. So it must be a Windows bug affecting TDBGrid. ---------------------------------------------------------------------- hrayon · 2017-02-21 15:38 Hi jacmoe, I followed your instructions to update, but  the problem with TDBGrid and TBufDataset persists. I think the howard pc is right, I just wish someone else using windows could check it out. If the problem does exist, I'll see how to register it in the bug list and try something else. ---------------------------------------------------------------------- balazsszekely · 2017-02-21 16:10 No issues on win7/Lazarus Trunk/FPC 3.0.0. I can resize it all day long, no records are duplicated. ---------------------------------------------------------------------- wp · 2017-02-21 16:18 hrayon. you must post a small project which shows the issue. Otherwise this is only wild guessing here, even code fragments are useless because the bug often is somewhere else. ---------------------------------------------------------------------- SunyD · 2017-02-21 16:31 I created bug report for this. http://bugs.freepascal.org/view.php?id=31375 ---------------------------------------------------------------------- jacmoe · 2017-02-21 16:38 Your bug report will have better chances if you supply a minimal project that reproduces the issue. ---------------------------------------------------------------------- SunyD · 2017-02-21 16:48 Quote from: jacmoe on February 21, 2017, 05:38:40 pmYour bug report will have better chances if you supply a minimal project that reproduces the issue. There is example project included. ---------------------------------------------------------------------- jacmoe · 2017-02-21 16:54 Quote from: Soner A. on February 21, 2017, 05:48:59 pmThere is example project included. D'oh - That's great! ---------------------------------------------------------------------- valdir.marcos · 2017-02-21 16:58 Quote from: hrayon on February 21, 2017, 02:25:43 pmWhile checkout is being done ... I do not know if I understand you very well, but is it your birthday today? If I'm right, happy birthday! And for your number of posts, I and many of us must thank you! (sorry my english) Quote from: Thaddy on February 21, 2017, 02:43:27 pmtnx    59... Number of posts doesn't count, about 20% was useful and accurate. About 5% without offending people by accident  Thaddy, happy birthday! Thanks for all your help. ---------------------------------------------------------------------- molly · 2017-02-21 17:06 Quote from: valdir.marcos on February 21, 2017, 05:58:49 pmThaddy, happy birthday! Thanks for all your help. + 1 ---------------------------------------------------------------------- hrayon · 2017-02-21 18:25 Hello GetMem, I assume you have not seen the problem happen since you are selecting the last record on the grid. Try to select some from the middle and do the resizing by dragging the window border. Thanks Soner A. for registering the bug report. ---------------------------------------------------------------------- hrayon · 2017-02-21 19:09 More bad news ... I did a test here with a virtual machine and the error occurred in linux also: Lubuntu 15.04, but I confess that sometimes I resized and it seemed that everything was fine, but I insisted a little and the error happened. Unfortunately, for the end user, if an error can happen it will happen. ---------------------------------------------------------------------- balazsszekely · 2017-02-21 19:20 @hrayon Since I deleted my original project, I downloaded @Soner A. test project from the bugtracker and indeed the bug is there. PS: Under windows you can catch WM_ENTERSIZEMOVE/WM_EXITSIZEMOVE message, then lock the window update. I just tested it works fine, but:    1. By this you only treat the symptom not the problem itself    2. The window is not updated until you finish resizing, alternatively you can lock only the grid    3. It's windows only However until the bug is fixed, you can use this solution as a workaround. ---------------------------------------------------------------------- SunyD · 2017-02-21 21:35 Today I found out when the bug occurs. Check my new note on bug report: http://bugs.freepascal.org/view.php?id=31375#c98361 Maybe someone can solve it. ---------------------------------------------------------------------- hrayon · 2017-02-21 22:14 @GetMem Thank you! Sorry my ignorance, but how to "lock the window update" or the same to the grid? By canvas? Do you have some small code snippet? I was trying by canvas, but don't works here. I do not understand perfectly the paint engine: The capturing messages is ok: 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 ...function WndCallback(AHWND: HWND; uMsg: UINT; wParam: WParam; lParam: LParam): LRESULT; stdcall;begin  case uMsg of    WM_ENTERSIZEMOVE:    begin    //block dbgrid here    end;    WM_EXITSIZEMOVE:    begin     //unblock dbgrid here    end;  end;  Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, LParam);end;... ---------------------------------------------------------------------- balazsszekely · 2017-02-22 05:58 @hrayon See attachment. As I said, is just a  temporary workaround(windows only) until the bug is fixed. Please test! ---------------------------------------------------------------------- hrayon · 2017-02-22 10:36 Thank you very much! ---------------------------------------------------------------------- balazsszekely · 2017-02-22 10:59 @hrayon You're welcome. @Soner A. I did a little background check. Interestingly enough with Laz1.4.4 /FCP 2.6.4 everything works fine,  in Laz 1.6/FPC 3.0 the bug is already present. So it was introduced somewhere between the two versions. This is most likely a FPC issue(db, sqldb, bufdataset ...), but I can tell for sure. You should locate the exact revision which caused the regression.  By locating the exact revision, you can find out what went wrong and  create a patch, otherwise you might have to wait month before it get fixed. Unfortunately I don't have the time or the motivation to do it.