View Issue Details

IDProjectCategoryView StatusLast Update
0005682JEDI VCL00 JVCL Componentspublic2012-09-10 14:15
Reportersound_effectsAssigned Toobones 
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.46 
Summary0005682: JvStringGrid's OnCaptionClick sometimes fires even for column-resizing clicks
DescriptionIt seems that JvStringGrid's OnCaptionClick sometimes fires when the user clicks between the columns to resize them.

Perhaps this should be considered more of a suggestion than a bug. I need OnCaptionClick to respond only to the "interior" caption clicks and ignore the caption edge clicks for column resizing.

As a workaround, I submit the attached patch. This exposes GridState as a property, giving OnCaptionClick a means to distinguish column-resizing clicks from interior clicks:

procedure TForm1.JvStringGrid1CaptionClick(Sender: TJvStringGrid;
  AColumn, ARow: Integer);
begin
  if Sender.GridState = gsColSizing then
    Exit;
    
  // Do something only when the caption gets an interior click...
end;



Additional InformationUsing RAD Studio 2009 on Vista 32-bit and Windows 7 64-bit.

I have not tested this patch with any versions of Delphi prior to 2009.
TagsNo tags attached.

Activities

2011-10-14 06:58

 

ExposeJvStringGridState.patch (1,198 bytes)
Index: run/JvExGrids.pas
===================================================================
--- run/JvExGrids.pas	(revision 13126)
+++ run/JvExGrids.pas	(working copy)
@@ -397,6 +397,7 @@
     procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
     procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
     property MouseOver: Boolean read FMouseOver write FMouseOver;
+    property GridState: TGridState read FGridState;
     property HintColor: TColor read FHintColor write FHintColor default clDefault;
     property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
     property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
Index: run/JvStringGrid.pas
===================================================================
--- run/JvStringGrid.pas	(revision 13126)
+++ run/JvStringGrid.pas	(working copy)
@@ -142,6 +142,7 @@
     procedure InvalidateRow(ARow: Integer);
     procedure MoveColumn(FromIndex, ToIndex: Integer);
     procedure MoveRow(FromIndex, ToIndex: Longint);
+    property GridState;
     property InplaceEditor;
 
     // Calculates and sets the width of a specific column or all columns if Index < 0

obones

2012-02-24 15:12

administrator   ~0019535

Too problematic to actually solve, I have made GridState public as suggested

Issue History

Date Modified Username Field Change
2011-10-14 06:58 sound_effects New Issue
2011-10-14 06:58 sound_effects File Added: ExposeJvStringGridState.patch
2012-02-22 14:38 obones Status new => acknowledged
2012-02-24 15:12 obones Note Added: 0019535
2012-02-24 15:12 obones Status acknowledged => resolved
2012-02-24 15:12 obones Fixed in Version => Daily / SVN
2012-02-24 15:12 obones Resolution open => fixed
2012-02-24 15:12 obones Assigned To => obones
2012-09-10 14:15 obones Fixed in Version Daily / SVN => 3.46