ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to scroll a TImageEnMView to the top?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Dec 27 2016 : 19:53:36
How can I scroll a TImageEnMView to the top?

With a TScrollBox you could use:

if ScrollBox.VertScrollBar.IsScrollBarVisible then
  ScrollBox.VertScrollBar.Position := 0;


But TImageEnMView does not have these Scrollbar properties. So how can I scroll a TImageEnMView to the top?
11   L A T E S T    R E P L I E S    (Newest First)
PeterPanino Posted - Dec 29 2016 : 04:13:27
Thanks Nigel!
xequte Posted - Dec 29 2016 : 01:13:44
Hi Peter

You can set ViewY := 0;

http://www.imageen.com/help/TImageEnMView.ViewY.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Dec 28 2016 : 13:39:39
If you do not want to have a frame selected then just call ImageEnMView1.Deslect after scrolling, regardless of the way you scroll the component.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
PeterPanino Posted - Dec 28 2016 : 13:35:39
That's what I wanted to achieve. But not by using a content selection but by programmatically moving the scrollbar to the top. Also with a TScrollBox, when scrolling to the top with the example code the content also moves.
w2m Posted - Dec 28 2016 : 13:22:45
As you simulate the vertical scrollbar position, the frames in the client area of the control changes. There is no way to scroll and not have the content change. With your example:
if ScrollBox.VertScrollBar.IsScrollBarVisible then
ScrollBox.VertScrollBar.Position := 0;
the visibility of the contents of the scrollbox will change.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
PeterPanino Posted - Dec 28 2016 : 13:20:25
SelectSeek "Moves the selection...", as the help file states.

Again: My question has nothing to do with the CONTENT of TImageEnMView but with its SCROLLBARS. Scrollbars can be programmatically moved which has nothing to do with the CONTENT of the control, although both the content and the scrollbars are synchronized by underlying code. Look at the Scrollbox code example at the top of this page.
w2m Posted - Dec 28 2016 : 13:00:21
I do not understand your question... "Isn't there a DIRECT way to scroll to the top?" My reply answered this question. Scrolling by setting the Selected Image := 0 is the same as Seek(ieioSeekFirst);

Your question does not make any sense to me.

Anyway... there is one more way:

TImageEnMView.SelectSeek

Declaration

procedure SelectSeek(pos: TIESeek);

Description

Moves the selection by the method specified by pos. SelectSeek will scroll the view, where necessary, to ensure the newly selected image is visible.

You can also simulate vertical scrollbar position with ViewY:
Declaration

property ViewY: integer;

Description

ViewY is the first row visible at the top-left corner of the control, in pixels (for example, if the user has scrolled vertically by two columns then it will return 2 * ThumbHeight). It is not relevant if GridWidth = 0 (in which case it always returns 0).

You can set ViewY to simulate vertical scrollbar movement.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
PeterPanino Posted - Dec 28 2016 : 12:54:16
Bill, thanks for trying to help. Your advice works, but it does not answer my question to DIRECTLY scroll to the top. Both "Seek" and "SelectImage" go to the top image and only as a SECONDARY EFFECT the control scrolls to the top.

My original question has nothing to do with the images but with the SCROLLING of TImageEnMView. Although for the user there may be no difference, from the programming point of view these are two completely different things.
w2m Posted - Dec 28 2016 : 11:34:27
ImageEnMView1.Seek(ieioSeekFirst);

I recommend you spend some time studying the help file. This is fully described in the help file.

TImageEnMView.Seek

Declaration

function Seek(Page : TIEIOSeekDestination) : integer;

Description

When DisplayMode is mdSingle then Seek sets VisibleFrame to display the first/previous/next/last image. Otherwise it sets SelectedImage to move the selection to the first/previous/next/last image. Returns the new page index.


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
PeterPanino Posted - Dec 28 2016 : 06:06:41
Hello Klaus,

thank you for your advice.

ImageEnMView1.SelectImage works only indirectly. Isn't there a DIRECT way to scroll to the top?
klausdoege Posted - Dec 28 2016 : 03:42:57
Hello Peter,
Simply set the cursor to image 0 with:
ImageEnMView1.SelectedImage := 0;


Klaus
www.klausdoege.de