Closed msarmc closed 7 years ago
Hi Mike,
thanks, I can confirm the bug. It is actually reproducible with the demos, Dialog
does not make any difference. I assume you are using the latest sources, because I cannot reproduce the bug with the latest released version 0.6.10.
Tomas,
That’s curious. I ran JavaKeywordsAsync to see if it had the problem but it didn’t. Maybe it is because I let it open at its default width of 600 instead of sizing it down so a horizontal scrollbar would be needed. If 0.6.10 doesn't have the bug I'll try that version.
I am using code I downloaded Nov 16th.
Thanks, Mike
Tomas,
I changed to use 0.6.10. This corrected the problem in one dialog. In the other dialog the horizontal scrollbar still did not work. In the second case CodeArea is in a SplitPane.
Mike
I apologize. One more thing. I should have checked this before the previous comment. The vertical scroll bar does not work either when in a SplitPane.
Does it only happen in a Dialog, or whenever in SplitPane?
I only tested in a Dialog. If I have time later today I'll test it in a SplitPane without using a dialog.
Using the snapshot I downloaded Nov 16 I tested using a SplitPane not in a dialog. The horizontal scroll bar does not work if there is no vertical scroll bar. If there is a vertical scroll bar both work.
Thanks, but I think we already established that there is a problem in the snapshot, regardless of the Dialog. I was interested to hear about the problem with the 0.6.10 version.
My apologies. When using 0.6.10 the horizontal scroll bar seems to work fine with the vertical scroll bar when in a SplitPane (and not in a Dialog)
Am I understanding this correctly? You downloaded the then-current snapshot version on Nov 16 (which occurred a few days before we de-skinned StyledTextArea). The problem you found was that, when a CodeArea is placed inside a SplitPane and its vertical scroll bar is not showing, the horizontal scroll bar doesn't work (i.e., scrolling horizontally doesn't work / dragging the bar doesn't scroll its content horizontally). Is that correct?
If so, then this problem no longer occurs. I've taken your example and modified it slightly as shown by
// --- explanation of change
comments. See the following code.
ScrollText-Dec 28 Snapshot.txt
Thanks Jordan!
Sorry, didn't mean to close this.
Not sure if this issue is considered solved. But I can confirm that it still exists in richtextfx-fat-0.7-M2, and the CodeArea does not have to be placed inside a SplitPane.
I've attached a demo class reproducing the issue. CodeAreaTest.txt
Tested on Windows 8.1 with
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
@isjns I tested out your code using the mouse to scroll horizontally and by clicking and moving the scrollbar. It worked fine for me. I'm on Linux with
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
I confirm the problem, I copy-pasted the code of @isjns then ran it : horizontal scrollbar does not work (win 7 64, jdk 1.8.0_91) see creen capture below :
Found another similar bug when I used CodeArea for another document. Instead of the horizontal scrollbar not working at all, it works to some extent. When you start dragging the scrollbar from left to right, it slows down more and more as you get closer to the right. Then the scrollbar "jumps" to its rightmost position, but some text is still hidden to the right. See this attached demo class: CodeAreaTest2.txt
Tested on Windows 8.1 with
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
The problem also occurs if I use a StyleClassedTextArea instead, but only if I manually set the font on it (??).
Both this and my previous issue uses the VirtualizedScrollPane by the way. So I'm not sure if we can say that it's an issue with the "CodeArea horizontal scrollbar" or with if it is an issue with VirtualizedScrollPane.
@isjns I tested your code and didn't have that issue. The scrollbar moved smoothly at a constant rate.
@JordanMartinez Still on Linux I guess? The bug seems to be Windows specific. Tested it on Windows 7 SP1 with Java 8u92 as well, with the same result as in Windows 8.1.
I'm seeing this on OS X using richtextfx-fat-0.7-M2.jar and the StyleClassedTextArea in a split pane. I'm still investigating, but it doesn't appear to be a purely Windows problem.
Same behavior: if the Vertical Scroll Bar is visible, horizontal scrolling works fine. I tried setVBarPolicy(ALWAYS); that didn't fix the problem. The StyleClassedTextArea actually has to have enough content to scroll vertically before horizontal scrolling will work.
I am having the same problem on Windows 7, Java 8u102:
The horizontal scrollbar of a StyleClassedTextArea
inside of a VirtualizedScrollPane
does not work (dragging or clicking on the scrollbar does not change the horizontal scroll) independent of the presence of an vertical scrollbar. (Just as shown in the screen capture of @MichelMunoz )
Scrolling is essential for a text area and Windows is a widely used operating system so this is a major bug.
Where do I have to look to find the cause? Is there something I can try to work around this?
Is anyone looking into this issue, as I am currently running into the same problems (on Windows)?
This is reproducible:
RichText.java
Alternatively any hints on how to investigate this would be much appreciated, too.
Finally I was able to find the issue:
VirtualizedScrollPane
which is already fixed but not jet released: Flowless:dc4acExcellent! I'll keep an eye out.
I can confirm what @synth3 wrote: horizontal scrollbar works with current Flowless master.
@TomasMikula could you please make a 0.5.2 release of Flowless to fix the horizontal scrollbar of RichTextFX?
Just FYI, if you're using Gradle, you should be able to update your build.gradle
file to the following as a temporary workaround until Tomas makes another release:
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile 'com.github.TomasMikula:Flowless:a2da8f732c9450ed4576bab80ad4e7084d70d9f0'
// exclude Flowless in RichTextFX dependency
compile (group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.7-M3') {
exclude group: "org.fxmisc.flowless", module: "flowless"
}
}
I have not tested this code personally, but if I'm following the directions for Jitpack correctly, this should work. Note: I'm using the commit hash, not the branch-SNAPSHOT
version, so this should work even if additional work is done on Flowless.
@TomasMikula Can you make a new Flowless release? Then we could make a release here with the newer changes as well.
I'm confused by the suggestion to exclude "flowless". At that point, VirtualizedScrollPane is no longer available and there are no scrollbars at all.
I believe it's excluding the current release of "flowless" in favor of a snapshot of "flowless" that has the desired fix.
That's not what happens unless I also specify that I want flowless separately. If you exclude flowless and nothing else specifies it as a dependency, it is excluded completely. If I need to specify it separately, what version works?
I'm not a Gradle user: but isn't that what the first "compile" statement in the Gradle spec does? It appears to be making a particular snapshot of "flowless" a dependency of your app, while removing it from compilation as a dependency of "richtextfx". So you get a copy, you just don't get the version "richtextfx" was expecting.
Ahhh... totally missed that line in the example. My bad. Thanks!
@jplwill @robross0606 Yeah, that's exactly what that line does. You'll see the same thing in the richtextfx module's build.gradle file as the version of Flowless that RTFX used at one time used an older version of ReactFX than what RTFX uses, causing an issue when figuring out which version to use in RTFX. Since that was Flowless' only dependency, we simply excluded it, though it should be refactored to only exclude the ReactFX dependency should Flowless ever need another dependency.
Flowless 0.5.2 released. Thanks for finding the problem!
Might take a few minutes before it appears on Maven Central.
Thanks!
Closed by #445.
Tomas, I am using a CodeArea in a Dialog. When there is no vertical scrollbar the horizontal scrollbar does not work. I modified JavaKeywordsAsync to demonstrate this. See the attached txt file (it wouldn't let me add a .java file) ScrollBarTest.txt
Thanks, Mike