Jump to content
Professor_Bernd

RichEdit with scrollbar on the left

Recommended Posts

I am working on a CallTipViewer for PSPad4AutoIt3. If the CallTip is very wide, it might be moved so that a scrollbar on the right side is not visible. Therefore I am looking for a way to place a scrollbar on the left side of the RichEdit.

I have seen in another thread a solution with $WS_EX_LAYOUTRTL for a listview. I tried it, but it does not work in this case because text is displayed backwards and other problems.

How can I create a RichEdit with scrollbar left?

Here is a demo code with the scrollbar on the right, so helpers will find it easier to help. ;)

_GUICtrlRichEdit_Create 4.au3

Share this post


Link to post
Share on other sites
2 hours ago, Professor_Bernd said:

I have seen in another thread a solution with $WS_EX_LAYOUTRTL for a listview. I tried it, but it does not work in this case because text is displayed backwards and other problems.

Probably not the perfect solution, but at least in your example it seems to work.

Instead :

$hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 100, BitOR($ES_MULTILINE, $WS_VSCROLL))

use :

$hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 100, BitOR($ES_MULTILINE, $WS_VSCROLL), $WS_EX_LAYOUTRTL)
  _GUICtrlRichEdit_SetParaAlignment($hRichEdit, "l")

 


Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites
Posted (edited)

Hello, Musashi.

Your code is exactly what I've already tried. :P Here is a screenshot of the result. Unfortunately, it solves one problem but creates another. The text is partly transposed or displayed backwards. In the first line the dot is at the beginning instead of the end. In the third line it is "2 - 1" instead of "1 - 2".

1886893605_ResultwithWS_EX_LAYOUTRTL.png.b4b418821a3b230119e1a1c0b171b907.png

Thanks for your effort. 👍

Bernd.

Edited by Professor_Bernd

Share this post


Link to post
Share on other sites
$hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 100, BitOR($ES_MULTILINE, $WS_VSCROLL), $WS_EX_LEFTSCROLLBAR)

Works for me correctly.  French setting / KB.

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, Nine said:

Works for me correctly.  French setting / KB.

Works for me as well, German setting.

But this style ($WS_EX_LEFTSCROLLBAR) is not documented here  (or am I blind?) Otherwise it would have been much easier to find it, of course ;).

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites
1 hour ago, Nine said:

Found it on MSDN :

Thanks, Nine.

I had found it there in the meantime as well. The info for WS_EX_LEFTSCROLLBAR states : "If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored."

No idea for which 'other' languages it is ignored, but in FR and DE it obviously works :). I will suggest, that it should be included in German help. There we have a member, who is sacrificially working to improve it. In the end, however, this style is probably of little importance for the majority.


Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites

Well, my understanding is that the MSDN explanation applies to a generic windows.  But in our case, we use it on a control.  I think the comment about shell language is not pertinent when it concerns a control.

Share this post


Link to post
Share on other sites
Posted (edited)

@Nine

I can also confirm that it works with DE Layout. A little worried about the limitation "for other languages". And I wonder if there is an important reason why it is not documented in the AutoIt help.

If the comment about the shell language is not relevant when it is a control, this would be a very simple and clean solution. Many thanks for this tip. 👍

@Musashi Thanks for testing and additional information.

 

Bernd.

Edited by Professor_Bernd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...