View Issue Details

IDProjectCategoryView StatusLast Update
0001544JEDI VCL00 JVCL Componentspublic2004-03-30 02:10
ReporterMarkus SpoettlAssigned Tomarcelb 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001544: JvInspector: Dragging the devider beyond the control's right edge error
DescriptionIf you drag the devider beyond the right edge the devider suddenly appears at the left edge. If you further move right the move (which still holding the left button) the devider moves to the right as well, until it reaches the edge of the control where it wraps again.

The problem is the linke "XB := X mod BWidth", the using the mod function here is questionable. I've added a fix in my local version by removing the mod, see additional information.
Additional Informationprocedure TJvCustomInspector.MouseMove(Shift: TShiftState; X, Y: Integer);
[...]
  begin
    BWidth := ClientWidth;
    BandIdx := -1;
  end;
// FIX BEGIN
  if (X >= BWidth) then
    X := BWidth;
  XB := X; // mod BWidth;
// FIX END
   XB := X mod BWidth;
   if DraggingDivider then
[...]
TagsNo tags attached.

Activities

marcelb

2004-03-29 23:58

manager   ~0003504

Yes, but now it will probably have some problems with UseBands = True.

anonymous

2004-03-30 00:32

viewer   ~0003505

Works fine in my test program using bands.

Markus

anonymous

2004-03-30 00:52

viewer   ~0003506

Ok, I have to correct that. My fix works only if using the devider in the first band, not if you use deviders in the bands to the right.

Markus

marcelb

2004-03-30 01:02

manager   ~0003508

I have a partial solution, but the behavior you mentioned will still apply when using bands (the divider will move back to the left in band mode only). Current fix:

  begin
    BWidth := ClientWidth;
    BandIdx := -1;
  end;
// FIX BEGIN
  if UseBands then
    XB := X mod BWidth
  else
    XB := X;
// FIX END

Will now look into the bands, because it should work exactly the same there. Will report back later.

marcelb

2004-03-30 02:10

manager   ~0003509

Fixed and tested in both band and non-band mode. Things you'll need to change:

-add a private field to TJvCustomInspector:
 FDividerDragBandX: Integer;
-add a protected property to TJvCustomInspector:
 property DividerDragBandX: Integer read FDividerDragBandX write FDividerDragBandX;
- change TJvCustomInspector.MouseDown:
 [...]
 // Check divider dragging
 if (XB >= Pred(DividerAbs)) and (XB <= Succ(DividerAbs)) then
 begin
   DraggingDivider := True;
   DividerDragBandX := BandIdx * BWidth;
 end
   // Check row sizing
  [...]
- change TJvCustomInspector.MouseMove:
  [...]
    BandIdx := -1;
  end;
  if UseBands and not DraggingDivider then
    XB := X mod BWidth
  else
  if UseBands and DraggingDivider then
    XB := X - DividerDragBandX
  else
    XB := X;
  if DraggingDivider then
    DividerAbs := XB
  [...]

Now it should work properly in all cases.

Issue History

Date Modified Username Field Change
2004-03-29 08:29 Markus Spoettl New Issue
2004-03-29 23:58 marcelb Note Added: 0003504
2004-03-29 23:58 marcelb Status new => confirmed
2004-03-30 00:32 anonymous Note Added: 0003505
2004-03-30 00:52 anonymous Note Added: 0003506
2004-03-30 00:57 marcelb Status confirmed => assigned
2004-03-30 00:57 marcelb Assigned To => marcelb
2004-03-30 01:02 marcelb Note Added: 0003508
2004-03-30 02:10 marcelb Status assigned => resolved
2004-03-30 02:10 marcelb Resolution open => fixed
2004-03-30 02:10 marcelb Note Added: 0003509