Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 19 Apr 2024, 07:39

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 16 Oct 2018, 14:13 
Offline

Joined: 22 Mar 2016, 11:45
Posts: 26
Hello,

In old versions of Ehlib (I think version 5) there was External scrollbar property for DBGridEh. In new versions it dosn't exist. Is there a way to use an external scrollbar for DBGridEh?

I want to set alignment of DBGridEh scrollbar to left when the BidiMode is LeftToRight and set it to right when the BidiMode is RightToLeft. Is it possible?


Top
 Profile  
 
PostPosted: 17 Oct 2018, 08:02 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

DBGridEh really no longer supports External scrollbar.
I think that is not an easy way to place the scrollbar on the left side in the LeftToRight mode.

You can try to change code in the next methods
Code:
procedure TCustomGridEh.UpdateScrollBarPanels;
...
    FHorzScrollBarPanelControl.SetBounds(SBLeftStartOffset, ClientHeight - SHeight, ClientWidth - SizeGripWidth - SBTopStartOffset, SHeight);

and


Code:
procedure TCustomGridEh.UpdateBoundaries;
...
  end else if VertScrollBar.IsScrollBarShowing {FVertAxis.RolLen > FVertAxis.RolClientLen} then

but not sure that everything will work as it should.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 14 Nov 2018, 03:24 
Offline

Joined: 22 Mar 2016, 11:45
Posts: 26
EhLibSupport wrote:
I think that is not an easy way to place the scrollbar on the left side in the LeftToRight mode.

If I want to place the vertical scrollbar on the right side in the both LeftToRight and RightToLeft mode is it easy and possible?

That's mean in the LeftToRight mode the vertical scrollbar normally is in the right side and we only change it's location in the RightToLeft mode and place it on the right side. Is it possible?


Top
 Profile  
 
PostPosted: 15 Nov 2018, 22:32 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

It is possible, but you cannot do this by setting the properties of the grid.
You should change source code of the grid in the method:
Code:
  procedure TCustomGridEh.UpdateScrollBarPanels;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 16 Nov 2018, 08:28 
Offline

Joined: 22 Mar 2016, 11:45
Posts: 26
EhLibSupport wrote:
Hello
You should change source code of the grid in the method:
Code:
  procedure TCustomGridEh.UpdateScrollBarPanels;

The procedure UpdateScrollBarPanels only specifies the scrollbars location depending on the bidimode. Which procedure shifts columns to right or left?


Top
 Profile  
 
PostPosted: 20 Nov 2018, 14:22 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

Grid does't change only columns direction.
He changes the orientation of the whole Сanvas.

See
Code:
procedure TCustomGridEh.Paint;
...
  if UseRightToLeftAlignment then ChangeGridOrientation(True);

....
    SetWindowOrgEx(Canvas.Handle, Org.X, Org.Y, nil);
    SetViewportExtEx(Canvas.Handle, ClientWidth, ClientHeight, nil);
    SetWindowExtEx(Canvas.Handle, Ext.X*ClientWidth, Ext.Y*ClientHeight, nil);


_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 22 Nov 2018, 13:44 
Offline

Joined: 22 Mar 2016, 11:45
Posts: 26
Now the vertical scroll bar position in DBGridEh and all windows controls is determined based on the type of language. In other words, if the language is a left to right language, the scroll bar is placed on the right of the control, yet if the language is written from right to left, the scroll bar is placed on the left. However, I think it would be better to determine the scroll bar position based on left- or right-handedness; namely, a right-handed person prefers to use the scroll bar on his right when using the mouse, while a left-handed person prefers the opposite. This can be added as a property to the DBGridEh so that the user selects the position based on his/her preference.

I look forward to receiving your feedback.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group