Lazarus
Programming => Packages and Libraries => RichMemo => Topic started by: Trenatos on April 14, 2016, 09:59:55 pm
-
I noticed something odd, and I did some tests.
If I create a RichMemo, and programmatically set wordwrap and scrollbars, only the second item gets set.
Example:
RichMemo1.ScrollBars:=ssAutoBoth;
RichMemo1.WordWrap:=false;
The above will only set WordWrap while not changing scrollbars, if I do this:
RichMemo1.WordWrap:=false;
RichMemo1.ScrollBars:=ssAutoBoth;
This time I only get scrollbars and no wordwrap.
I'm guessing this is a bug, but are there any workarounds?
I'm on OSX El Capitan, Lazarus 1.6, Carbon.
-
r4621
-
I uninstalled the old one, updated SVN, opened compiled and installed r4621 but looks to be having the same behavior, is there some way I can confirm that the package I'm using is the correct one?
-- Edit
I created a new application, placed a button and a TRichMemo, added a long text, and on the button click handler I do this:
RichMemo1.WordWrap:=false;
RichMemo1.ScrollBars:= ssAutoBoth;
WordWrap turns off, but scrollbars don't seem to work, they also don't work if I set scrollbar option in the object inspector.
-
what makes you think scrollbars don't work?
-
When I set scrollbars programmatically, they don't show up at all, and when I do it with the object inspector, they show up when I do both on, but there's no scroll marker, at least for horizontal (Did not test vertical)
-
After a little testing, here's the behavior I'm seeing;
If I do this:
currentRichMemo.WordWrap := false;
currentRichMemo.ScrollBars := ssAutoBoth ;
WordWrap turns off, and I get a vertical scrollbar which works as it should, but I do not get a horizontal scrollbar even though the text is definitely wider than the richmemo.
-
Well. it's been working like this for awhile.
I cannot find a link now, but I there was some mentioning that horizontal scrollbars won't even show in carbon rich edit. Need to do some more investigations on this.
-
Is there anything I can do to help?
It's the last piece I need working before I can release a piece of software I've been working on, so if there's anything I can do to help, I'm happy to give it a go.
-
Is there anything I can do to help?
don't use wordwrap :D
but seriously... here's a test you could do.
Place TScrollBox on an empty form.
Add TRichMemo into it. Important: Make sure that RichMemo scrollbars are set to ssNone.
Make TRichMemo bigger than TScrollBox itself (so both horizontal and vertical scrollbars should be shown).
Add some text ... and see if Horizontal and Vertical scrollbars are showing up on the ScrollBar.
-
Yes that works.
Both scrollbars show up and work (And works with magic mouse too, which Lazarus IDE does not, I filed an error report about that a while back)
-
magic mouse too
a magic mouse?
-
Apple wireless buttonless mouse, uses touch sensors for swiping, scrolling, etc.
With it you can scroll horizontally as easily as vertically, but Lazarus has issues with horizontal magic mouse scroll.. BUT it seems to work with the scrollbox, which is odd..
-
Apple wireless buttonless mouse, uses touch sensors for swiping, scrolling, etc.
With it you can scroll horizontally as easily as vertically, but Lazarus has issues with horizontal magic mouse scroll.. BUT it seems to work with the scrollbox, which is odd..
and what's the bug report # for it?
-
The id is 0029972
-
Need to do some more investigations on this.
Standard OSX scrolling view is buggy with HITextView (the richedit).
Thus it's necessary to implement own scroll view that would handle horizontal scrolling.
Potentially it should be possible, since TScrollBox works for you, which is implemented by TCarbonScrollingWinControl.
-
That's pretty much what I figured, but I've no idea how to fix it.
My skills in Object Pascal are not good enough yet to contribute bugfixes, but I'll get there.
Any idea of the time/effort involved in fixing the issue? I'm happy to offer a bit of money for a bugfix (Within reason :P), since it's the last piece I need to release an open source software I've been working on.
-
...sigh...
here's a workaround (spent 2+ hours polishing it). It's a workaround, because it actually implements what you might need (non-wordwrapped RichMemo with horizontal scroll) by using external component TScrollBox and TRichMemo itself. (The proper fix should do it within CarbonRichMemo itself)
The workaround is using OSX specific APIs to extract necessary layout information. Thus if you're to use it in your cross-platform project, you'll have to use $ifdefs.
The workaround also recommends to use r4623 of RichMemo. The revision implements OnSelectionChange event support.
You might also notice that RichMemo is yellow and ScrollBox is green in the workaround project. The colors are set via object inspector and could be reset to default colors, if needed.
P.S. speaking of monetary rewards. You could donate some dollars to the community. The link is on the left side of this forum.