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
 Scrollbar problem in TImageEnMView

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 - Oct 29 2017 : 08:36:21
I have set the width of my (one-column) TImageEnMView to fit its content:



But when it has a scrollbar (due to diminished height) then the scrollbar reduces its client width:



Isn't there a setting to keep the client width when TImageEnMView has a scrollbar? I.e., the scrollbar should not take space from the client width but rather automatically enlarge the control's width.

This would be very useful. If there is no such option then please implement it.
4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 29 2017 : 23:53:56
Cool.

FYI, in v7.0.2, a better method will be as follows:


procedure Tfrmmain.ImageEnMView1Changed(Sender: TObject);
const
  HORZ_PADDING = 8;
var
  newWidth: Integer;
begin
  // Widen control if scrollbar is visible
  newWidth := ImageEnMView1.ThumbSizeInfo( itsOuter ).X + HORZ_PADDING;
  if ImageEnMView1.CurrentScrollBars = ssVertical then
    inc( newWidth, IEGlobalSettings().VScrollWidth() );
  ImageEnMView1.Width := newWidth;
end;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
PeterPanino Posted - Oct 29 2017 : 15:47:56
Thanks, I have solved this now in a very nice way.
xequte Posted - Oct 29 2017 : 15:06:12
Hi


You can use the OnImageAdded event:

https://www.imageen.com/help/TImageEnMView.OnImageAdded.html


To check whether there are scollbars visible:

https://www.imageen.com/help/TImageEnMView.CurrentScrollBars.html


And set the width to include or exclude the scollbar width using these two values:

https://www.imageen.com/help/TIEImageEnGlobalSettings.VScrollWidth.html
https://www.imageen.com/help/TImageEnMView.ThumbSizeInfo.html


Something like:

procedure Tfrmmain.ImageEnMView1ImageAdded(Sender: TObject; idx: integer);
begin
  newWidth := ImageEnMView1.ThumbSizeInfo( itsOuter ).X;
  if ImageEnMView1.CurrentScrollBars = ssVertical then
    inc( newWidth, IEGlobalSettings().VScrollWidth() );
  ImageEnMView1.Width := newWidth;
end;


Though, I see this does not handle it when the image count is then reduced, so I'll need to check our event handling and come back to you.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Oct 29 2017 : 09:12:08
There is no option to do this as far as I know. I just adjust the width to be wider to so that the text is not cut off. When you do this however there is extra space until the scrollbar appears.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development