XE7 unusable - TVertScrollBox.ScrollBy not work [Edit]

Hi,

XE7 - Now the method ScrollBy of TVertScrollBox component not work. :(

var
  R: TRectF;
begin
  VertScrollBoxPaciente.Align := TAlignLayout.Top;
  R := TRectF.Create(0,0,768,560);
  VertScrollBoxPaciente.BoundsRect := R;
  VertScrollBoxPaciente.ScrollBy(0, -130);
end;

Does anyone have a solution?

Thanks,
Best regards,
Jose A.

Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:15 PM

Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:18 PM
0
Jose
9/9/2014 8:18:18 PM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

9 Replies
2786 Views

Similar Articles

[PageSpeed] 46

> {quote:title=Jose Antonio Molina Busquiel wrote:}{quote}
> Hi,
> 
> XE7 - Now the method ScrollBy of TVertScrollBox component not work. :(
> 
> var
>   R: TRectF;
> begin
>   VertScrollBoxPaciente.Align := TAlignLayout.Top;
>   R := TRectF.Create(0,0,768,560);
>   VertScrollBoxPaciente.BoundsRect := R;
>   VertScrollBoxPaciente.ScrollBy(0, -130);
> end;
> 
> Does anyone have a solution?

Define "doesn't work".

It _looks_like_ the containership gets broken but that is not the case and it looks like it works right to me on a quick glance.  You set R to a huge area that is likely bigger than the item(s) in your scrollbox and I cannot tell because you didn't provide; then the scroll bar disappears.  Is this what you are referring to?  If so, I might say "working as designed".  Try the same thing but stick a StringGrid in the VertScrollBox, bind to some big dataset so you have a ton of rows (not required but helps v
isualize), now inside your procedure add StringGrid1.Height := 4000; so you have a really tall object in the scrollbox and see what happens.  Behavior looks a lot different, right?
--
John Frazier (Embarcadero Newsgroup Admin)
0
John
9/9/2014 8:46:32 PM
You need something inside the VertScrollbox in order to scroll to it.

I tried it and it works.

If VertScrollBoxPaciente is the scrollbox, I don't think you want to change the BoundsRect. You just want to put things in it and use VertScrollBoxPaciente.ScrollBy to scroll to them.
0
Douglas
9/9/2014 10:31:02 PM
I have same problem.
try this:

VertScrollBoxPaciente.RealignContent;
VertScrollBoxPaciente.ScrollBy(0, -130);


Gianni

> {quote:title=Jose Antonio Molina Busquiel wrote:}{quote}
> Hi,
> 
> XE7 - Now the method ScrollBy of TVertScrollBox component not work. :(
> 
> var
>   R: TRectF;
> begin
>   VertScrollBoxPaciente.Align := TAlignLayout.Top;
>   R := TRectF.Create(0,0,768,560);
>   VertScrollBoxPaciente.BoundsRect := R;
>   VertScrollBoxPaciente.ScrollBy(0, -130);
> end;
> 
> Does anyone have a solution?
> 
> Thanks,
> Best regards,
> Jose A.
> 
> Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:15 PM
> 
> Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:18 PM
0
giovanni
9/11/2014 10:05:27 AM
> {quote:title=John Frazier wrote:}{quote}
> > {quote:title=Jose Antonio Molina Busquiel wrote:}{quote}
> > Hi,
> > 
> > XE7 - Now the method ScrollBy of TVertScrollBox component not work. :(
> > 
> > var
> >   R: TRectF;
> > begin
> >   VertScrollBoxPaciente.Align := TAlignLayout.Top;
> >   R := TRectF.Create(0,0,768,560);
> >   VertScrollBoxPaciente.BoundsRect := R;
> >   VertScrollBoxPaciente.ScrollBy(0, -130);
> > end;
> > 
> > Does anyone have a solution?
> 
> Define "doesn't work".
> 
> It _looks_like_ the containership gets broken but that is not the case and it looks like it works right to me on a quick glance.  You set R to a huge area that is likely bigger than the item(s) in your scrollbox and I cannot tell because you didn't provide; then the scroll bar disappears.  Is this what you are referring to?  If so, I might say "working as designed".  Try the same thing but stick a StringGrid in the VertScrollBox, bind to some big dataset so you have a ton of rows (not required but helps
 visualize), now inside your procedure add StringGrid1.Height := 4000; so you have a really tall object in the scrollbox and see what happens.  Behavior looks a lot different, right?
> --
> John Frazier (Embarcadero Newsgroup Admin)

The same code in the same program, in XE6 works great, so it is a XE7 problem.
0
Jose
9/11/2014 10:23:28 AM
> {quote:title=Douglas Rudd wrote:}{quote}
> You need something inside the VertScrollbox in order to scroll to it.
> 
> I tried it and it works.
> 
> If VertScrollBoxPaciente is the scrollbox, I don't think you want to change the BoundsRect. You just want to put things in it and use VertScrollBoxPaciente.ScrollBy to scroll to them.

This is an example, of course, the verticalscrollbox contains, the same code works perfectly on XE6. ;-)

Edited by: Jose Antonio Molina Busquiel on Sep 11, 2014 3:23 AM
0
Jose
9/11/2014 10:24:40 AM
It doesn't matter if it worked in XE6. Maybe XE6 was wrong. Maybe things changed.
You have to give me a simple project example so I can see what you are doing different from me.
You can upload it to the attachments forum.
0
Douglas
9/11/2014 12:19:26 PM
Hi Jose, I found solution

TForm1 = class(TForm)
    VertScrollBox1: TVertScrollBox;
    procedure VertScrollBox1CalcContentBounds(Sender: TObject;  var ContentBounds: TRectF);
  private
    { Private declarations }
    AContentBounds: TRectF;
  procedure GotoBottom;
  procedure GotoTop;
  public
    { Public declarations }
  end;

procedure TForm1.VertScrollBox1CalcContentBounds(Sender: TObject;
  var ContentBounds: TRectF);
begin
  AContentBounds:=  ContentBounds; 
end;
procedure TForm1.GotoBottom
begin
  VertScrollBox1.ViewportPosition := PointF(VertScrollBox1.ViewportPosition.X, AContentBounds.Height);
  VertScrollBox1.RealignContent;
end;

procedure TForm1.GotoTop
begin
  VertScrollBox1.ViewportPosition := PointF(VertScrollBox1.ViewportPosition.X, 0);
  VertScrollBox1.RealignContent;
end;

> {quote:title=Jose Antonio Molina Busquiel wrote:}{quote}
> Hi,
> 
> XE7 - Now the method ScrollBy of TVertScrollBox component not work. :(
> 
> var
>   R: TRectF;
> begin
>   VertScrollBoxPaciente.Align := TAlignLayout.Top;
>   R := TRectF.Create(0,0,768,560);
>   VertScrollBoxPaciente.BoundsRect := R;
>   VertScrollBoxPaciente.ScrollBy(0, -130);
> end;
> 
> Does anyone have a solution?
> 
> Thanks,
> Best regards,
> Jose A.
> 
> Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:15 PM
> 
> Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:18 PM
0
giovanni
9/12/2014 8:42:19 AM
> {quote:title=giovanni di pietrantonio wrote:}{quote}
> Hi Jose, I found solution
> 
> TForm1 = class(TForm)
>     VertScrollBox1: TVertScrollBox;
>     procedure VertScrollBox1CalcContentBounds(Sender: TObject;  var ContentBounds: TRectF);
>   private
>     { Private declarations }
>     AContentBounds: TRectF;
>   procedure GotoBottom;
>   procedure GotoTop;
>   public
>     { Public declarations }
>   end;
> 
> procedure TForm1.VertScrollBox1CalcContentBounds(Sender: TObject;
>   var ContentBounds: TRectF);
> begin
>   AContentBounds:=  ContentBounds; 
> end;
> procedure TForm1.GotoBottom
> begin
>   VertScrollBox1.ViewportPosition := PointF(VertScrollBox1.ViewportPosition.X, AContentBounds.Height);
>   VertScrollBox1.RealignContent;
> end;
> 
> procedure TForm1.GotoTop
> begin
>   VertScrollBox1.ViewportPosition := PointF(VertScrollBox1.ViewportPosition.X, 0);
>   VertScrollBox1.RealignContent;
> end;
> 
> > {quote:title=Jose Antonio Molina Busquiel wrote:}{quote}
> > Hi,
> > 
> > XE7 - Now the method ScrollBy of TVertScrollBox component not work. :(
> > 
> > var
> >   R: TRectF;
> > begin
> >   VertScrollBoxPaciente.Align := TAlignLayout.Top;
> >   R := TRectF.Create(0,0,768,560);
> >   VertScrollBoxPaciente.BoundsRect := R;
> >   VertScrollBoxPaciente.ScrollBy(0, -130);
> > end;
> > 
> > Does anyone have a solution?
> > 
> > Thanks,
> > Best regards,
> > Jose A.
> > 
> > Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:15 PM
> > 
> > Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:18 PM

Thanks Giovanni, although I think this should fix Embarcadero.
In all ways, there are too many problems when working with the forms in the IDE.
I guess we have to wait to update1.
Best regards,
Jose A.

Edited by: Jose Antonio Molina Busquiel on Sep 15, 2014 3:44 AM
0
Jose
9/15/2014 10:44:44 AM
> {quote:title=Jose Antonio Molina Busquiel wrote:}{quote}
> > {quote:title=giovanni di pietrantonio wrote:}{quote}
> > Hi Jose, I found solution
> > 
> > TForm1 = class(TForm)
> >     VertScrollBox1: TVertScrollBox;
> >     procedure VertScrollBox1CalcContentBounds(Sender: TObject;  var ContentBounds: TRectF);
> >   private
> >     { Private declarations }
> >     AContentBounds: TRectF;
> >   procedure GotoBottom;
> >   procedure GotoTop;
> >   public
> >     { Public declarations }
> >   end;
> > 
> > procedure TForm1.VertScrollBox1CalcContentBounds(Sender: TObject;
> >   var ContentBounds: TRectF);
> > begin
> >   AContentBounds:=  ContentBounds; 
> > end;
> > procedure TForm1.GotoBottom
> > begin
> >   VertScrollBox1.ViewportPosition := PointF(VertScrollBox1.ViewportPosition.X, AContentBounds.Height);
> >   VertScrollBox1.RealignContent;
> > end;
> > 
> > procedure TForm1.GotoTop
> > begin
> >   VertScrollBox1.ViewportPosition := PointF(VertScrollBox1.ViewportPosition.X, 0);
> >   VertScrollBox1.RealignContent;
> > end;
> > 
> > > {quote:title=Jose Antonio Molina Busquiel wrote:}{quote}
> > > Hi,
> > > 
> > > XE7 - Now the method ScrollBy of TVertScrollBox component not work. :(
> > > 
> > > var
> > >   R: TRectF;
> > > begin
> > >   VertScrollBoxPaciente.Align := TAlignLayout.Top;
> > >   R := TRectF.Create(0,0,768,560);
> > >   VertScrollBoxPaciente.BoundsRect := R;
> > >   VertScrollBoxPaciente.ScrollBy(0, -130);
> > > end;
> > > 
> > > Does anyone have a solution?
> > > 
> > > Thanks,
> > > Best regards,
> > > Jose A.
> > > 
> > > Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:15 PM
> > > 
> > > Edited by: Jose Antonio Molina Busquiel on Sep 9, 2014 1:18 PM
> 
> Thanks Giovanni, although I think this should fix Embarcadero.
> In all ways, there are too many problems when working with the forms in the IDE.
> I guess we have to wait to update1.
> Best regards,
> Jose A.
> 
> Edited by: Jose Antonio Molina Busquiel on Sep 15, 2014 3:44 AM

No need to constantly call RealignContent.
Also you can use ScrollBox1.ContentBounds


Here are two versions workaround.

procedure TForm29.Button4Click(Sender: TObject);
var
  P: TPointF;
begin
  P := ScrollBox1.ViewportPosition;
  P.Offset(0, 130);
  ScrollBox1.ViewportPosition := P;
end;

procedure TForm29.Button5Click(Sender: TObject);
begin
  ScrollBox1.AniCalculations.MouseWheel(0, 130);
end;

ScrollBy will fixed in next version. Sorry
0
Sergey
10/14/2014 1:01:01 AM
Reply:

Similar Artilces:

Does Delphi XE5 firemonkey work on current Samsung tablets? [Edit]
I am being told that Delphi XE5 with firemonkey will not work on the current range of Samsung tablets even if they have Android 4 is that true? If so I will be very disappointed having invested thousands of pounds and a few hundred hours to adopt the technology on the promise I can now deploy to Android mobile devices. When I run even the most simple Hello World app I simply get a black screen on my brand new Samsung tablet. I am told it only works on Android devices with a ARMv7 CPU supporting NEON instruction sets. If this is the case developers need to know that I have been told today ...

PHP -> JSON ->Zlib -> Delphi XE7 [win32 -> work | android -> No mapping ] [Edit]
Мy program for android should get data from the server as yson when to perform under vindovs works, and in android error, please help! PHP: {code} $err = array(); $data = array('id'=>1,'name'=>'test','info'=>'1234'); $inf = array('data' => $data ,'error' => $err); $json = json_encode($inf); $json = gzencode(trim(preg_replace('/\s+/',' ',$json )),9); header('Content-Encoding: gzip'); header("content-type: text/html; charset: UTF-8"); header("cache-control: must-revalidate&qu...

PHP -> JSON ->Zlib -> Delphi XE7 [win32 -> work | android -> No mapping ] [Edit] #2
Мy program for android should get data from the server as json when to perform under Win32 works, and in android error, please help! PHP: {code} $err = array(); $data = array('id'=>1,'name'=>'test','info'=>'1234'); $inf = array('data' => $data ,'error' => $err); $json = json_encode($inf); $json = gzencode(trim(preg_replace('/\s+/',' ',$json )),9); header('Content-Encoding: gzip'); header("content-type: text/html; charset: UTF-8"); header("cache-control: must-revalidate"...

PHP -> JSON ->Zlib -> Delphi XE7 [win32 -> work | android -> No mapping ] [Edit] #2
Мy program for android should get data from the server as yson when to perform under vindovs works, and in android error, please help! PHP: {code} $err = array(); $data = array('id'=>1,'name'=>'test','info'=>'1234'); $inf = array('data' => $data ,'error' => $err); $json = json_encode($inf); $json = gzencode(trim(preg_replace('/\s+/',' ',$json )),9); header('Content-Encoding: gzip'); header("content-type: text/html; charset: UTF-8"); header("cache-control: must-revalidate&qu...

PHP -> JSON ->Zlib -> Delphi XE7 [win32 -> work | android -> No mapping ] [Edit] #2
Мy program for android should get data from the server as yson when to perform under vindovs works, and in android error, please help! PHP: {code} $err = array(); $data = array('id'=>1,'name'=>'test','info'=>'1234'); $inf = array('data' => $data ,'error' => $err); $json = json_encode($inf); $json = gzencode(trim(preg_replace('/\s+/',' ',$json )),9); header('Content-Encoding: gzip'); header("content-type: text/html; charset: UTF-8"); header("cache-control: must-revalidate&qu...

Code works in Delphi 7 but not in Delphi 2010 [Edit]
hello, i have a procedure that open's a file by passing the file name as the parameter to the executable. something like this {code} C : \ P r o g r a m F i l e s \ Da c k e r \ D r a c k e r . e x e " G : \ D E l p h i 7 \ D e l p h i 7 A p p _ l o g . t " {code} The source code is {code} procedure OpenFileWithExe var hReg: HKEY; Ret: Longint; RegDataType, RegDataSize: DWORD; CmdLine: array [0..560] of Char; Len: Integer; SInfo: TStartupInfo; PInfo: TProcessInformation; begin Ret := windows.RegOpenKeyEx(HKEY_CURRENT_USER, ...

FastScript in Delphi XE8
I am converting from Delphi 2006 to Delphi XE8, and am now nearing the finish line, but have one remaining major roadblock: FastScript I use Fastscript very heavily as a way to allow our users to write scripts that can extend our software as much as they like, including creating forms and adding buttons. This is not working. A specific problem that I have, is that code that works great in Delphi 2006 does not work in Delphi XE8. Specifically, if my script contains a reference to a "TForm", or "TBitBtn" (as well as many other components), then FastScript will return ...

FastScript in Delphi XE8
*Edit: This is now solved, but I leave the original message below for reference. The solution was essentially to delete all traces of FastReports (That's "Reports", not "Script") from the computer, as it was interfering with FastScript. This was actually fairly involved to do, and we did it under the supervision of someone from FastScript tech support, who was extremely helpful. If you run into the problem described below, be sure to contact their technical support and see if maybe you are experiencin g the same issue, and how to resolve it. I hope this is helpfu...

Delphi xe7 TLocationSensor not working
I've found that the TLocationSensor control is no longer working in my iOS apps. I'm testing with the Location Demo app that is supplied. The app works fine on android but on iOS the app does not request location permission and as a result I'm not getting any LocationChanged events. When I look at the location permissions it never gets set and if I set it manually the app actually resets it to empty. Pretty weird, but QC says it works for them. I've tested on iPhone 4, iphone 5 and iPad air. I'm using Xcode 6.1, iOS 8.1, delphi xe 7 with the beta ld that's sup...

Delphi XE7 TIBDatabase.SysEncryptPassword [Edit]
Hello everyone, I have noticed after upgrading from Delphi XE6 to XE7, that TIBDatabase successfully connects to my encrypted database without setting the SysEncryptPassword property. At the same time, if I set sys_encrypt_password parameter for TIBDatabase at design time (as I used to do in Delphi XE6), I am getting "DPB Constant () is unknown" error message. Connection is successful when I am not using sys_encrypt_password parameter Are SysEncryptPassword property and sys_encrypt_password parameter deprecated in Delphi XE7 release of IBX? Thanks Vladimir Edited by...

Azure Baas will not work with Delphi XE7?
This is part of a sample program for an Android phone app that stores data in a Azure storage. The following code worked fine in Delphi XE5 and Delphi XE6 but not in XE7. I get no errors at compile and run time, but when it connects to Azure storage and try to queryentities(tablename) it just closes the program. public tableservice : TAzureTableService; var aRow: TCloudTableRow; rowsList: TList<TCloudTableRow>; begin rowsList := TableService.QueryEntities(tablename); //This is where it fails because I can comment it out and the program will stay up and not...

XE7 Firemonkey for Android HTTPRIO Problem [Edit]
WSDL : *http://www.byjg.com.br/site/webservice.php/ws/cep?WSDL* {code} unit Principal; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Graphics, FMX.Forms, FMX.Dialogs, FMX.TabControl, System.Actions, FMX.ActnList, FMX.StdCtrls, FMX.Layouts, FMX.Memo, FMX.Edit, Soap.InvokeRegistry, Soap.Rio, Soap.SOAPHTTPClient; type TfmPrincipal = class(TForm) TabControl1: TTabControl; TabItem1: TTabItem; TabItem2: TTabItem; TopToolBar: TToolBar; ToolBarLabel: TLabel; TopToolBar1: TToolBar; ToolBarLabel1: TLab...

Delphi XE7 with EMS and Sql server [Edit]
Hi, we currently sell a large read only firebird database with a sophisticated delphi written search engine application on the front end. We connect using IBObjects, with fbclient32.dll. Very simple works well, however... The clients host the data locally and serve the client app on their LAN either standalone PC's or Citrix. We update the data once a week using a service written in Delphi that stops the firebird service, downloads the new entire database from Amazon S3 and overwrites the old one and starts the firebird service again. It works again quite well but I want to move ...

Delphi XE2 + Windows XP. Does it work? [Edit]
We want to migrate from Delphi 2006 to Delphi XE2. Our OS is Windows XP. Does XE2 run on Windows XP? What are your experiences? Thanks, R. Edited by: Ronnie Smith on Jan 27, 2012 12:29 AM I bet it does. Windows Platforms The following Windows platforms are supported as development platforms: Microsoft® Windows 7 (32-bit and 64-bit) Microsoft Windows VistaTM SP2 (32-bit and 64-bit) requires administrator rights Microsoft Windows XP Home or Professional (32-bit and 64-bit) SP2 or SP3 Microsoft Windows Server 2003 (SP1) or 2008 (32-bit and 64-bit) The latest service...

TreeView.Color Not Working
Hi All Anyone tried to set the TreeView.Color when the Project|Options|Application|Appearance is "Slate Classico" At design time its fine, but at runtime the Color is white. Any ideas why ? tia Changing the Appearence to something other than "Windows" also denies the font colour to be changed on a TLabel. ...

Web resources about - XE7 unusable - TVertScrollBox.ScrollBy not work [Edit] - embarcadero.delphi.firemonkey

Resources last updated: 1/11/2016 8:28:27 AM