View Issue Details

IDProjectCategoryView StatusLast Update
0024780PatchesLCLpublic2014-01-04 12:50
ReporterCyrax Assigned ToJesus Reyes  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Fixed in Version1.0.13 (SVN) 
Summary0024780: [patch] Grids : Don't set column widths when loading component.
DescriptionSee summary and attached patch file.
TagsNo tags attached.
Fixed in Revision42958
LazTarget-
Widgetset
Attached Files

Relationships

related to 0025235 closedJuha Manninen Lazarus Not publishing AutoFillColumn of TValueListEditor breaks existing forms 

Activities

Cyrax

2013-07-24 08:17

reporter  

grids.pas.patch (883 bytes)   
Index: lcl/grids.pas
===================================================================
--- lcl/grids.pas	(revision 42191)
+++ lcl/grids.pas	(working copy)
@@ -2157,6 +2157,7 @@
   end;
 
   OldSize := integer(PtrUInt(FCols[ACol]));
+
   if NewSize<>OldSize then begin
 
     if OldSize<0 then
@@ -2163,10 +2164,11 @@
       OldSize := fDefColWidth;
 
     Bigger := NewSize>OldSize;
-    SetRawColWidths(ACol, AValue);
 
     if not (csLoading in ComponentState) and HandleAllocated then begin
 
+      SetRawColWidths(ACol, AValue);
+
       if FUpdateCount=0 then begin
         UpdateSizes;
         R := CellRect(aCol, 0);
@@ -8681,6 +8683,7 @@
   FUnCheckedBitmap := LoadResBitmapImage('dbgriduncheckedcb');
   FCheckedBitmap := LoadResBitmapImage('dbgridcheckedcb');
   FGrayedBitmap := LoadResBitmapImage('dbgridgrayedcb');
+
 end;
 
 destructor TCustomGrid.Destroy;
grids.pas.patch (883 bytes)   

Jesus Reyes

2013-09-26 14:33

developer   ~0070348

What problem does it fix?, Please attach a test project.

Cyrax

2013-09-26 15:20

reporter  

test_project.zip (2,076 bytes)

Cyrax

2013-09-26 15:22

reporter   ~0070350

Attached test project. This bug affects only TValueListEditor. In design mode Key and Name columns have default widths but when project is run, only Name column is visible.

Jesus Reyes

2013-09-26 15:41

developer   ~0070354

Here it seems to work: I opened your project, Key and Name columns are visible, I run the project, still they are visible and, apparently, with the same widths. As this report do not have any Lazarus revision/version or OS/Widgetset indication, I tested under Linux with trunk version.

Cyrax

2013-09-26 15:52

reporter  

Clipboard01.png (8,176 bytes)   
Clipboard01.png (8,176 bytes)   

Cyrax

2013-09-26 15:54

reporter   ~0070355

Last edited: 2013-09-26 15:56

View 2 revisions

Attached picture demonstrates problem. Widgeset is Win32/Win64.

Lazarus 1.3 r42799 FPC 2.7.1-r25569 [2013/09/25] i386-win32-win32/win64

fpc make options all install sourceinstall UPXPROG=echo OPT="-gw2 -godwarfsets
-gl -O- -OoNO -Xs-" COMPILER_OPTIONS="-gw2 -godwarfsets -gl -O- -OoNO -Xs-" INST
ALL_PREFIX=i:\free_pascal_and_lazarus\free_pascal_and_lazarus\fpc\trunk\build\tr
unk_x32 REVSTR=25569 IDE=1

lazarus make options make all UPXPROG=echo OPT="-gw2 -godwarfsets -gh -gl -O- -
OoNO -dHEAPTRC_WINDOW -Xs-" USESVN2REVISIONINC=0

Jesus Reyes

2013-09-27 05:16

developer   ~0070372

Thank you, I was able to reproduce the problem, your patch worked fine but I decided to fix the problem using the AutoFillColumns feature of the grid replacing the custom method it was using.

Cyrax

2013-09-27 09:50

reporter   ~0070377

Thanks for the fix but now user can't resize fixed Key and Name columns by mouse.

Jesus Reyes

2013-09-27 15:34

developer   ~0070391

please try r42986 which fix a recent commit that broke selection and resizing when editor is visible (r42943)

Cyrax

2013-09-27 18:21

reporter   ~0070401

Now it works.

But there is something odd going on. If I turn doKeyColFixed to False, I can't resize columns. Changing it to True, resizing columns works. Should this work in reverse so False allows resizing or have I misunderstood something?

Jesus Reyes

2013-09-27 19:46

developer   ~0070405

Last edited: 2013-09-27 19:47

View 2 revisions

If I understood correctly, the "fixed" in doKeyColFixed means the column is not automatically sizeable. So if set to false, just toggle the automatic resizing On (but only if doAutoColResize is on too). If columns are automatically sizeable, the user can not resize them.

Issue History

Date Modified Username Field Change
2013-07-24 08:17 Cyrax New Issue
2013-07-24 08:17 Cyrax File Added: grids.pas.patch
2013-09-26 14:33 Jesus Reyes Assigned To => Jesus Reyes
2013-09-26 14:33 Jesus Reyes Status new => assigned
2013-09-26 14:33 Jesus Reyes LazTarget => -
2013-09-26 14:33 Jesus Reyes Note Added: 0070348
2013-09-26 14:33 Jesus Reyes Status assigned => feedback
2013-09-26 15:20 Cyrax File Added: test_project.zip
2013-09-26 15:22 Cyrax Note Added: 0070350
2013-09-26 15:22 Cyrax Status feedback => assigned
2013-09-26 15:41 Jesus Reyes Note Added: 0070354
2013-09-26 15:52 Cyrax File Added: Clipboard01.png
2013-09-26 15:54 Cyrax Note Added: 0070355
2013-09-26 15:56 Cyrax Note Edited: 0070355 View Revisions
2013-09-27 05:16 Jesus Reyes Fixed in Revision => 42958
2013-09-27 05:16 Jesus Reyes Note Added: 0070372
2013-09-27 05:16 Jesus Reyes Status assigned => resolved
2013-09-27 05:16 Jesus Reyes Fixed in Version => 1.0.13 (SVN)
2013-09-27 05:16 Jesus Reyes Resolution open => fixed
2013-09-27 09:50 Cyrax Note Added: 0070377
2013-09-27 09:50 Cyrax Status resolved => assigned
2013-09-27 09:50 Cyrax Resolution fixed => reopened
2013-09-27 15:34 Jesus Reyes Note Added: 0070391
2013-09-27 18:21 Cyrax Note Added: 0070401
2013-09-27 19:46 Jesus Reyes Note Added: 0070405
2013-09-27 19:46 Jesus Reyes Status assigned => resolved
2013-09-27 19:46 Jesus Reyes Resolution reopened => fixed
2013-09-27 19:47 Jesus Reyes Note Edited: 0070405 View Revisions
2013-10-17 17:14 Cyrax Status resolved => closed
2014-01-04 12:50 Juha Manninen Relationship added related to 0025235