[MSEide-MSEgui-talk] How to use form-scrollbars ?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] How to use form-scrollbars ?

fredvs
Hello Martin.

I did try to change position of scrollbar of a form by code.

Without luck.

Using theform.container.frame.sbhorz.pageup works only once.

Howto do if the button of a TSlider goes outside the form, how to , by code,
do a page-up of the scrollbar.

This to have the button of the Tslider always visible.

<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/mse_scrollbar2.png>

Thanks.



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

mse
Administrator
On Tuesday 19 June 2018 12:12:54 fredvs wrote:
> Hello Martin.
>
> I did try to change position of scrollbar of a form by code.
>
> Without luck.
>
> Using theform.container.frame.sbhorz.pageup works only once.
>
Works for me. Maybe it is already at 100% after the first call?.
In order to set the scrollbar positions set container.frame.scrollpos.

> Howto do if the button of a TSlider goes outside the form, how to , by
> code, do a page-up of the scrollbar.
>
> This to have the button of the Tslider always visible.
>
"
container.clampinview(<therect>);
"
twidget.clampinview() is public in git master
9d3b7cf14c8d122df9123d46d7e375e08d3b1c69.


Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

fredvs
> In order to set the scrollbar positions set container.frame.scrollpos.

Huh, not too easy for me to understand.

container.frame.scrollpos.x := container.frame.scrollpos.x + 100;
 
==> Error: Argument cannot be assigned to

container.frame.scrollpos_x := container.frame.scrollpos_x + 100;;

==> Compiles but does work only once.

>Maybe it is already at 100% after the first call?

No, only 20 %.

Sorry, I do not understand how scrollpos works.

For example, if a Tslider.width = 16 * parent_form.width, how to jump to the
3th page (if each page = 1 form.width) using the scrollbar by code ?

> container.clampinview(<therect>);

Ha, thanks. (But what is this ?).
OK, exploration in view,..

;-)

Fre;D





--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

fredvs
Hello Martin.

Sorry, I do not understand the goal of clampinview.

Now about container.frame.sbhorz.pageup/pagedown.

With a simple demo-test it works.
This demo use the same waveform.pas than a other more complicated project.

See attachment and video.

msescrolltest.zip
<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/msescrolltest.zip>  
msescrollpage_alone.mp4
<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/msescrollpage_alone.mp4>  

But inside a more complicated project, with same code, it does not work.

See video.
msescrollpage_strum.mp4
<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/msescrollpage_strum.mp4>  

The menu-items Up/Down to scroll use this:
(waveform.pas, line 239)

procedure twavefo.pageup(const sender: TObject);
begin
 container.frame.sbhorz.pageup ;
end;

procedure twavefo.pagedown(const sender: TObject);
begin
container.frame.sbhorz.pagedown ;
end;

And there is no call to wavefo from outside, nor any timer working.
But you may see in video that scrolling by code works only once in
StrumPract.

https://github.com/fredvs/strumpract

;-(

Do you have a idea what is wrong ?

:-)

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

mse
Administrator
In reply to this post by fredvs
On Tuesday 19 June 2018 23:02:23 fredvs wrote:

> > In order to set the scrollbar positions set container.frame.scrollpos.
>
> Huh, not too easy for me to understand.
>
> container.frame.scrollpos.x := container.frame.scrollpos.x + 100;
>
> ==> Error: Argument cannot be assigned to
>
> container.frame.scrollpos_x := container.frame.scrollpos_x + 100;;
>
> ==> Compiles but does work only once.
>
> >Maybe it is already at 100% after the first call?
>
> No, only 20 %.
>
> Sorry, I do not understand how scrollpos works.
>
It sets the position of the topleft corner of the virtual client rectangle of
the scrolling area (twidget.clientrect) which is bigger than the rectangle
built by widget frame (twidget.paintrect). Reference is the topleft corner of
paintrect.
"
 tscrollbox1.frame.scrollpos:= mp(-30,-10);
"
in order to set the origin of clientrect to 30 pixel left of the origin of
paintrect and 10 pixels above paintrect.

> For example, if a Tslider.width = 16 * parent_form.width, how to jump to
> the 3th page (if each page = 1 form.width) using the scrollbar by code ?
>
container.frame.scrollpos_x:= -3*parentformwidth.

> > container.clampinview(<therect>);
>
It adjusts scrollpos so <therect> is in paintrect.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

mse
Administrator
In reply to this post by fredvs
On Wednesday 20 June 2018 03:30:44 fredvs wrote:
> Hello Martin.
>
> Sorry, I do not understand the goal of clampinview.
>
It adjusts scrollpos so the given rectangle is in paintrect.

> Now about container.frame.sbhorz.pageup/pagedown.
>
> With a simple demo-test it works.
[...]
> But inside a more complicated project, with same code, it does not work.
>
Probably because a widget gets active. If a widget will be activated it calls
clampinview().
"
procedure twidget.doactivate;
var
 rect1: rectty;
begin
 if fparentwidget <> nil then begin
  rect1:= getdisprect;
  if rect1.x < 0 then begin
   rect1.cx:= rect1.cx + rect1.x;
   rect1.x:= 0;
  end;
  if rect1.x + rect1.cx > fwidgetrect.cx then begin
   rect1.cx:= fwidgetrect.cx - rect1.x;
  end;
  if rect1.y < 0 then begin
   rect1.cy:= rect1.cy + rect1.y;
   rect1.y:= 0;
  end;
  if rect1.y + rect1.cy > fwidgetrect.cy then begin
   rect1.cy:= fwidgetrect.cy - rect1.y;
  end;
  addpoint1(rect1.pos,fwidgetrect.pos);
  subpoint1(rect1.pos,fparentwidget.paintpos);
  fparentwidget.clampinview(rect1,false);
 end;
 activechanged;
end;
"

I'll add another flag in order to suppress the behavior.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

mse
Administrator
On Wednesday 20 June 2018 07:17:29 Martin Schreiber wrote:
>
> I'll add another flag in order to suppress the behavior.
>
Done, git master f98ccf1516ab16ff6812991424d80fbcc55b006b.

Martin



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

fredvs
> Done, git master f98ccf1516ab16ff6812991424d80fbcc55b006b.

Thanks but I get same "only once" behaviour with this last commit.

Maybe I miss something.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

mse
Administrator
On Wednesday 20 June 2018 13:50:21 fredvs wrote:
> > Done, git master f98ccf1516ab16ff6812991424d80fbcc55b006b.
>
> Thanks but I get same "only once" behaviour with this last commit.
>
> Maybe I miss something.
>
Have you set ow1_noclampinview of the widgets in container which will be
activated after you set the scroll position?

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

fredvs
Hello Martin.

Goooooal.

Here the tips:

1) Recompile MSEide / ideU with last MSEgui commits.

2) In object inspector, select the TSlider and set ow1_noclampinview :=
true.

3)  msescrollpage_strumOK.mp4
<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/msescrollpage_strumOK.mp4>  

Wow, once again, impressed by your high level of understanding.

Yes, MSEgui is really yours.

Many thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] How to use form-scrollbars ?

fredvs
In reply to this post by mse
> container.frame.scrollpos_x:= -3*parentformwidth.

wavescroll_strump.mp4
<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/wavescroll_strump.mp4>  

;-)

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk