Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread ViewPort / Surface & ComboBox Scrolling
Fri, May 11 2018 10:59 AMPermanent Link

Eivind

All

I have been away from EWB for roughly a year now so I might have missed something. I started building a project recently and run into som issues with scrolling. From my previous projects I had this in the OnShow Event of the form:

  With Application do begin
     ViewPort.OverflowY:=otAuto;
     ViewPort.OverflowX:=otAuto;
     surface.Constraints.min.width:=(Self.width+40);
     surface.Constraints.min.height:=(Self.height+40);
  end;

This triggers the scrollbars and I can scroll with the mouse wheel. However, when I want to scroll a control on that form with the mouse wheel, both the control and the Form / Surface scrolls. I have tried with a ButtonComboBox, EditComboBox and ListBox. See the attached VDO for an example. As yo can see in the VDO, as soon as the mouse are inside the control and I start scrolling, both the control and the surface is scrolling.

I might be missing something here. Is there som new code to activate the surface to scroll on forms larger than the ViewPort, or is the code I'm using above  good? I have already updated to build 12 today as I thought maybe that could help, but with no avail.

Thanks for any pointers

Eivind



Attachments: EWB-Scroll .mp4
Wed, May 16 2018 10:29 PMPermanent Link

Eivind

Nobody sees the same as me, or have the same issues with lists and combo boxes? All other controls behave nicely except those two. Could this be an issue only on my computer then?

Br
Eivind
Thu, May 17 2018 5:06 AMPermanent Link

Uli Becker

Eivind,

> Nobody sees the same as me, or have the same issues with lists and combo boxes? All other controls behave nicely except those two. Could this be an issue only on my computer then?

Please help us to help you: it would be a good idea to attach a sample project that demonstrates the issue.

Uli
Thu, May 17 2018 6:56 AMPermanent Link

Matthew Jones

Eivind wrote:

> Nobody sees the same as me, or have the same issues with lists and combo boxes? All other controls behave nicely except those two. Could this be an issue only on my computer then?

The application viewport has been discussed by Tim before, so that's where I'd start. By not messing with it. 8-)

--

Matthew Jones
Thu, May 17 2018 9:21 AMPermanent Link

Mark Brooks

Slikware

Avatar

Eivind wrote:

>> Nobody sees the same as me, or have the same issues with lists and combo boxes? All other controls behave
>> nicely except those two. Could this be an issue only on my computer then?

Funnily enough I have seen something a little strange with some of my apps, that I "think" may have crept in somewhere recently. It's not the same scenario as yours, but similar enough to make me think that they could be connected. I'll document it here in case Tim takes a read and can see a relationship.

My scenario is this:

- web app running on iPad or iPhone
- Main form is resized to always fit screen size
- Content scrolls inside main form via TScrollPanel descendant and TBasicPanel children therein

Lately, when I scroll the content of the TScrollPanel, the entire app (i.e main form and content) also scrolls (using the iOS bump effect) either up or down. It's really weird and certainly didn't used to happen.

It almost seems as though the "scroll event" is being propagated upwards beyond the target control, to the outermost container.

Make any sense?
Thu, May 17 2018 9:28 AMPermanent Link

Mark Brooks

Slikware

Avatar

And here's a short video that displays the behaviour on an iPhone



Attachments: EWB Strange Scrolling.mp4
Thu, May 17 2018 10:00 AMPermanent Link

Eivind

@Mark
I agree. It could be connected. I'm only seeing this on the ComboBox and ListBox controls. For example in the grid, it scrolls perfectly without messing with the main scroll.

@Uli
I could certainly upload a simple test case in addition to the VDO.

    ViewPort.OverflowY:=otAuto;
    ViewPort.OverflowX:=otAuto;
    surface.Constraints.min.width:=(Self.width+40);
    surface.Constraints.min.height:=(Self.height+40);

Anyhow, the code above I used in previous project over a year ago. Now I'm back again and was wondering what I can use to now to make the native scroll bars appear on forms that is larger than the browsers View area. What are you guys using to achieve this?

Thanks
Eivind
Fri, May 18 2018 1:17 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eivind,

<< I have been away from EWB for roughly a year now so I might have missed something. I started building a project recently and run into som issues with scrolling. From my previous projects I had this in the OnShow Event of the form:

  With Application do begin
     ViewPort.OverflowY:=otAuto;
     ViewPort.OverflowX:=otAuto;
     surface.Constraints.min.width:=(Self.width+40);
     surface.Constraints.min.height:=(Self.height+40);
  end;

This triggers the scrollbars and I can scroll with the mouse wheel. However, when I want to scroll a control on that form with the mouse wheel, both the control and the Form / Surface scrolls. I have tried with a ButtonComboBox, EditComboBox and ListBox. See the attached VDO for an example. As yo can see in the VDO, as soon as the mouse are inside the control and I start scrolling, both the control and the surface is scrolling. >>

This is a bug - during the mouse wheel changes over the last year, the base list control class was not updated properly.   The hot fix is as follows:

WebLists unit:

function TListControl.DoMouseWheel(WheelDelta: Integer; ShiftKey, CtrlKey, AltKey: Boolean; X,Y: Integer): Boolean;
begin
  Result:=inherited DoMouseWheel(WheelDelta,ShiftKey,CtrlKey,AltKey,X,Y);
  if FScrollSupport then
     begin
     ScrollBy(WheelDelta div FItemHeight);
     Result:=True;  <<<<<<<<<<<<<<<<<<< Add !!!
     end;
end;

A fix will be in B13.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, May 18 2018 1:24 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mark,

<< My scenario is this:

- web app running on iPad or iPhone >>

My guess is that this is a bug in Safari that we can't fix, but I'll check it out.

<< It almost seems as though the "scroll event" is being propagated upwards beyond the target control, to the outermost container. >>

Probably, but EWB isn't doing it.  You can verify this by doing the same with Chrome using the device emulation.

Tim Young
Elevate Software
www.elevatesoft.com
Sat, May 19 2018 1:54 AMPermanent Link

Eivind

Just like magic! That did the trick. Thanks again Tim for your prompt support



function TListControl.DoMouseWheel(WheelDelta: Integer; ShiftKey, CtrlKey, AltKey: Boolean; X,Y: Integer): Boolean;
begin
  Result:=inherited DoMouseWheel(WheelDelta,ShiftKey,CtrlKey,AltKey,X,Y);
  if FScrollSupport then
     begin
     ScrollBy(WheelDelta div FItemHeight);
     Result:=True;  <<<<<<<<<<<<<<<<<<< Add !!!
     end;
end;

Elevate Software
www.elevatesoft.com
Page 1 of 2Next Page »
Jump to Page:  1 2
Image