Jump to content


Photo

Scroll to a specific control in scroll box


  • Please log in to reply
11 replies to this topic

#1 WillemvanZyl

WillemvanZyl

    Member

  • uniGUI Subscriber
  • PipPip
  • 32 posts

Posted 10 October 2017 - 07:09 AM

Hi,

 

I have a TUnimScrollbox that contains many edit controls. I want to scroll to a specific control but get an access violation when I try the following call:

 

MyScrollBox.ScrollInView(TheEditToView);

 

Any help?


  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 10 October 2017 - 12:53 PM

Hi,

We will check this.

Best regards,
  • 0

#3 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 10 October 2017 - 06:41 PM

Hi,

 

Can you use WebFocus method for this ?!:

UnimEditxxx.WebFocus;

Best regards,


  • 0

#4 WillemvanZyl

WillemvanZyl

    Member

  • uniGUI Subscriber
  • PipPip
  • 32 posts

Posted 10 October 2017 - 07:37 PM

Hi,

 

Unfortunately this method did not work


  • 0

#5 Mqtt

Mqtt

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 05 March 2018 - 11:37 AM

Hi,
is there already a solution found?

 

I would need this.

 

Thank you!


  • 0

#6 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 05 March 2018 - 12:21 PM

Hi,

 

Hi,
is there already a solution found?

 

I would need this.

 

Thank you!

 

Which build are you using ?!

 

And can you make a simple testcase for your issue ?


  • 0

#7 Mqtt

Mqtt

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 05 March 2018 - 12:57 PM

Hi,

i use the newest version, i'm totally new to unigui (and javascript..)

Version 1.0.0.1425

 

I added a UnimScrollbox, then three panels (with one button each ) inside.

 

 

unit Mainm;

 

interface

 

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics,

  Controls, Forms, uniGUITypes, uniGUIAbstractClasses,

  uniGUIClasses, uniGUImClasses, uniGUIRegClasses, uniGUIForm, uniGUImForm, uniGUImJSForm,

  unimPanel, uniGUIBaseClasses, unimScrollBox, uniButton, unimButton;

 

type

  TMainmForm = class(TUnimForm)

    UnimScrollBox1: TUnimScrollBox;

    UnimPanel1: TUnimPanel;

    UnimPanel2: TUnimPanel;

    UnimPanel3: TUnimPanel;

    UnimButton1: TUnimButton;

    UnimButton2: TUnimButton;

    UnimButton3: TUnimButton;

    procedure UnimButton2Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

function MainmForm: TMainmForm;

 

implementation

 

{$R *.dfm}

 

uses

  uniGUIVars, MainModule, uniGUIApplication;

function MainmForm: TMainmForm;

begin

  Result := TMainmForm(UniMainModule.GetFormInstance(TMainmForm));

end;

 

procedure TMainmForm.UnimButton2Click(Sender: TObject);

begin

//UnimButton1.WebFocus;

Unimscrollbox1.ScrollInView(UnimButton1);  //App Execption!

//Unimscrollbox1.VertScrollBar.Position:=0;

end;

initialization

  RegisterAppFormClass(TMainmForm);

 

end.

 

 

 


  • 0

#8 Mqtt

Mqtt

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 08 March 2018 - 03:09 PM

For three day now, i evaluated all other possibilities. Listboxes, Grids, Dbgrids... Every control has its own disadvantage.

 

I'm sorry, but i need this function working for having a need for the whole unigui...


Could you please take again a look for Unimscrollbox1.ScrollInView?


  • 0

#9 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 08 March 2018 - 06:03 PM

Hi,

 

Can you try to use this approach for now?!

 

For example:

//Unimscrollbox1.ScrollInView(UnimButton1);  //App Execption!
UnimButton1.JSInterface.JSCode('document.getElementById('#1'.id).scrollIntoView(false);');

https://www.w3school...ollintoview.asp

 

Best regards,


  • 0

#10 Mqtt

Mqtt

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 09 March 2018 - 11:19 AM

Yes!!! Great!!

 

Thank you very, very much!


  • 0

#11 Mqtt

Mqtt

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 09 March 2018 - 11:34 AM

Currently i got it working in UniScrollbox, but not Unimscrollbox (mobile). Could you check this, please?
  • 0

#12 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4987 posts

Posted 09 March 2018 - 12:11 PM

Please make a simple testcase for this if possible ?!


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users