Results 1 to 10 of 10
Thread: Formatted Code Area is too big
- 06-12-2011, 05:37 PM #1
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Formatted Code Area is too big
When a posting uses the "Code tags" to post code the code is displayed in a separate text area. When the code reaches a certain number of lines scrollbars appear. However, I believe the maximum height of this code area is too big. For an example of what I mean see these two postings:
Need help adding an actionListener
http://www.java-forums.org/database/...-database.html
The height of the code area will display about 150 lines of code. After this the scrollbars appear. In my case I find this verry difficult to use. First I need to scroll the web page down to the bottom of the code area to see the visible code. However, I can't scroll the code down because the bottom of the scrollbar is not visible, so I have to scroll the web page up a lttle to grab the scrollbar and then scroll the code.
I think the the height of the "code area" should be limited to about 45 lines of code so that this area is completely visible without scrolling the entire page. If the user wants to look at the code in more detail, then they can use the scrollbar to see the code.
I use 1024 X 768 resolution, so I understand the number of lines that are visible can vary for different resolutions, so maybe the max height of the code area can vary by resolution? Or maybe this can be a user setting?Last edited by camickr; 06-12-2011 at 05:48 PM.
- 06-13-2011, 08:23 AM #2
Hi camickr,
I can change the height of the code box but i would like to get other people's input before doing it.
I had changed the the height of the code box myself years ago...
It looks like your resolution is too low.
We need a plugin to change it based on resolution but there is no such plugin as far as i know.
For source codes, i believe it is better to have larger area of the code visible so you dont need to go up and down to see what was defined and used before.
It looks like we need to decide on an optimal size for everybody. Can you attach a screenshot to help us visualize your problem for 1024x768 resolution?
- 06-13-2011, 08:56 AM #3
Senior Member
- Join Date
- Apr 2010
- Location
- Philippines
- Posts
- 580
- Rep Power
- 4
I agree with camickr, code area is too big to fit, I try 1366x768 resolution but still the area is too long
- 06-13-2011, 09:07 AM #4
1600 X 900 and the code box in http://www.java-forums.org/database/...-database.html is about 2½ screens high. I get 60 lines of code in one screen.
I feel that camickr's suggestion of 45 lines is good. Alternatively, if the code area doesn't have its own scrollbars, there's no problem in scrolling the whole page. It's the dual scroll bars that make reading difficult.
db
- 06-13-2011, 04:48 PM #5
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
agreed.i believe it is better to have larger area of the code visible...
Yes, this is the main problem.It's the dual scroll bars that make reading difficult.
Which is why I suggested this could maybe be a user setting. The setting could allow you to see all lines in the text area so there is never a scrollbar or a maximum number of lines after which a scrollbar would appear.We need a plugin to change it based on resolution but there is no such plugin as far as i know.
I attached an image of my screen.
Last edited by camickr; 06-13-2011 at 04:50 PM.
- 06-13-2011, 10:03 PM #6
I can not see the image.I attached an image of my screen.
Here is the description for that setting.
There is one setting related to this: Maximum [CODE] LinesCode is displayed as pre-formatted text which does not wrap when it reaches the edges of the table. By placing the code within a scroll box we avoid the situation where the pre-formatted text stretches the forum layout. This setting allows you to specify the maximum height of the scroll box before a scroll bar is displayed.
I set it to to 100000 to disable it but it looks like there is still a scrollbar around codes.When a user posts a block of [CODE], [PHP] or [HTML] in one of their messages, the system will place it in a box, which expands to contain their message.
This value controls the number of lines at which the box stops adding height and inserts a scrollbar.
Let me know what you think.
- 06-14-2011, 08:08 AM #7
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Strange, one of the postings has scrollbars and the other doesn't. Its better with this change. Now you don't have to worry about the two scrollbars.I set it to to 100000 to disable it but it looks like there is still a scrollbar around codes.
I still think the best solution is one that allows each user to choose the numbers of lines to display before the scrollbars appear. However, I understand this is a much larger change that would require a change to the database that maintains user preferences, so I'm happy to live with your current solution. Maybe adding a user preference can be kept in the back of your mind for future upgrades.
Thanks.
- 06-14-2011, 08:29 AM #8
- 06-14-2011, 08:39 AM #9
Is it the scrollbar around the post or code (note i am not refering to the scrollbar for the whole page)? Because i see scrollbars around posts time to time (i guess this happened after the upgrade).
I agree about the best solution. But it requires modification to the forum software or adding a plugin to do that. And both of them is not possible at the moment. I will keep this in mind.
Actually i am totally dissatisfied with the code tag. It does not highlight Java properly. I am planning to develop a Java service in a near future for proper code formatting. Once it is developed, i will use it on Java forums too. Hopefully, you will see many many new features implemented like this in a near future but i have to finish my thesis (which always prevented me to realize my ideas/plans so far
) in next few months..
- 06-14-2011, 08:42 AM #10
Similar Threads
-
Properly formatted code
By Bgreen7887 in forum New To JavaReplies: 1Last Post: 11-22-2010, 04:28 PM -
Inner glow on Area (source code)
By happy_hippie in forum Java 2DReplies: 0Last Post: 04-22-2010, 06:48 AM -
Formatted JTextfield with format <INT>.<INT> or <INT>
By itaipee in forum AWT / SwingReplies: 0Last Post: 03-25-2010, 11:50 AM -
displaying a formatted output on a jTextField
By techbossmb in forum AWT / SwingReplies: 1Last Post: 09-24-2009, 04:56 PM


LinkBack URL
About LinkBacks
Reply With Quote


Bookmarks