Office LnFs bugs

General Discussion goes here.

Moderator: robert

Office LnFs bugs

Postby RogerLacroix » Sat Apr 21, 2012 12:38 am

Hi Robert,

I have been using Office LnFs suite for several years with various Java programs. Since, most of my users are on Windows, the Office LnFs gives the user a nice familiar look and feel.

I have found 4 bugs in Office LnFs that I would like you to fix.

1. On Vista or Win 7, if you use a JCheckBoxMenuItem for a JMenu component, the check-mark is offset in the box. i.e. It needs to be raised up and to the left by about 4-6 pixels.

2. Changing the Tab Size of JTabbedPane does not work. Office LnFs completely ignores it.
Code: Select all
JTabbedPane tp = new JTabbedPane();
tp.addTab("<html><body leftmargin=15 topmargin=8 marginwidth=15 marginheight=5>General</body></html>", new JLabel("Text Component 1"));

I also tried using an icon of 32x32 and Office LnFs completely ignores it too.

3. I have a JFrame with 7 components (very simple app) and 2 of the components are JTextField that are very long (i.e. 50 characters). The 7 components are added to a JPanel and the JPanel is added to the JFrame. When I do a pack() method on the JFrame, Office LnFs appears to mis-calcalute the components sizes by roughly 25%. Hence, I end up with extra blank space to the right of the components. If I switch look & feel component (to cross-platform for example) then the pack() method works just fine.

4. Office LnFs also has a problem calculating the proper width of a JToolBar. In this case, it comes up short by 15-20%.

I would greatly appreciate if you could take some time and fix these bugs.

On a different note, have you ever thought about creating a cross-platform look & feel that is modeled after your VisualStudio2005 Look & Feel?? I know it sounds weird, but it would allow me to offer the same Look & Feel on Linux and Mac OS X, as it is on Windows.

Regards,
Roger Lacroix
RogerLacroix
 
Posts: 6
Joined: Tue Sep 29, 2009 3:17 pm
Location: London, ON Canada

Re: Office LnFs bugs

Postby robert » Sun Apr 22, 2012 5:38 am

HI Roger,

Glad you like the LaFs! It's been awhile since I looked at them. I actually started working on a newer, VS2010/Office2010 LAF, this time a clean break from the original OfficeLnFs project, but never got very far into it.

Anyway, as to your questions:

1. That issue is actually fixed, but you have to grab the latest from SVN. Tomorrow I'll find some time to upload a new version onto SourceForge with this fix (thought I had done it earlier). The improvements over 2.7 include the following (maybe more, this is all that's doc'd):

  • JCheckBoxMenuItem/JRadioButtonMenuItem offsets wrong in Vista & Windows 7.
  • Improved background painting of uneditable JComboBox's selected items in Vista & 7.
  • Fix for HTML tags being taken into account when calculating menu item width.

2. I'm assuming this is with the VS2005 LookAndFeel specifically, since it has a custom tabbed pane? Yes, it probably has some hard-coded stuff in it. I can try to take a look.

3. Can you provide a short, self-contained demo application that exhibits the problem? Email or private message is fine if it's too big to post here, but hopefully you can make an example in one relatively short class.

4. I haven't noticed this. Any specific example? Maybe you're putting some component(s) into a toolbar that I usually don't? (I usually stick to buttons).

I'd love to make a nice looking LookAndFeel, but unfortunately I have no artistic talent. I can only copy :D In fact, that was a problem (to me) with the OfficeLnFs, the Office applications never really customized any components except for the main window's menu bar and toolbars. This made some of the stuff in them difficult to implement (have to check parent components, etc.). This would be a lot of extra work to do to get all widgets looking like a coherent package across all OS's. The latest Office suite and Visual Studio appear to have more examples of customized components though, and one could create a LookAndFeel that uses their custom components to create a much more complete LAF. I started this awhile back but am nowhere near done with it, and don't work on it too much unfortunately.

[EDIT]: I just uploaded version 3.0 on SourceForge. It includes the 3 fixes outlined above. I started looking at a fix for #2 above last night, but no promises on when it'll get done.
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm

Re: Office LnFs bugs

Postby RogerLacroix » Tue Apr 24, 2012 9:19 pm

robert wrote:Glad you like the LaFs! It's been awhile since I looked at them. I actually started working on a newer, VS2010/Office2010 LAF, this time a clean break from the original OfficeLnFs project, but never got very far into it.

Yah, I really like "Visual Studio 2005" L&F. If/when you have VS2010 L&F ready, let me know and I will try it out.

robert wrote:Tomorrow I'll find some time to upload a new version onto SourceForge with this fix (thought I had done it earlier). The improvements over 2.7 include the following (maybe more, this is all that's doc'd):

I grabbed version 3.0 JAR file and the JCheckBoxMenuItem appears to be fixed. Great.

robert wrote:2. I'm assuming this is with the VS2005 LookAndFeel specifically, since it has a custom tabbed pane? Yes, it probably has some hard-coded stuff in it. I can try to take a look.

I wouldn't call using HTML in the tab title as a custom pane.

I tested the other 2 L&F (Office2003 & OfficeXP) in OfficeLnFs and they do not have the issue. Hence, something was missed in L&F for VisualStudio2005.

I found a hack for it but I would prefer that you fix the issue.
Code: Select all
if ("Visual Studio 2005".equalsIgnoreCase(UIManager.getLookAndFeel().getName()))
{
   tp.setUI(new org.fife.plaf.VisualStudio2005.VisualStudio2005TabbedPaneUI()
   {
      protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight)
      {
          return super.calculateTabHeight(tabPlacement, tabIndex, fontHeight) + 8;
      }
   });
}


robert wrote:3. Can you provide a short, self-contained demo application that exhibits the problem? Email or private message is fine if it's too big to post here, but hopefully you can make an example in one relatively short class.

Yes. I will try and find your email address.

robert wrote:4. I haven't noticed this. Any specific example? Maybe you're putting some component(s) into a toolbar that I usually don't? (I usually stick to buttons).

I only put JButtons in it. I mentioned this to you a long, long time ago.

Here is a screen-shot for issues # 3 and 4.
Image

As you can see, the "raised" toolbar does not cover all of the icons (issue # 4) and on the far right, there is empty space (issue # 3).

Regards,
Roger Lacroix
RogerLacroix
 
Posts: 6
Joined: Tue Sep 29, 2009 3:17 pm
Location: London, ON Canada

Re: Office LnFs bugs

Postby robert » Wed Apr 25, 2012 1:17 pm

Thanks Roger. I'll take a look at what you sent.

By "custom tabbed pane," I didn't mean your use of HTML in the title, I meant VS2005's custom TabbedPaneUI. I started working on this, still some kinks to work out, mostly with RTL support. One thing that I'm sure you're already aware of is that, if you use HTML in tabbed pane titles, you lose the selected tab having its text made bold (since HTML trumps the standard rendering of the title, on all L&F's). Are you okay with this? Or would you rather the VS2005 LAF auto-insert <b> and </b> tags in the selected tab when HTML is discovered? I'm not sure that everybody would appreciate such unexpected behavior... maybe a system property to toggle whether it happens or not?
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm

Re: Office LnFs bugs

Postby RogerLacroix » Wed Apr 25, 2012 11:50 pm

robert wrote:if you use HTML in tabbed pane titles, you lose the selected tab having its text made bold (since HTML trumps the standard rendering of the title, on all L&F's)

I hadn't noticed that. I have set UIManager.put("TabbedPane.selected", new Color(184,180,143)); to color the selected tab, so I didn't notice that the bold was missing.

robert wrote:Are you okay with this? Or would you rather the VS2005 LAF auto-insert <b> and </b> tags in the selected tab when HTML is discovered? I'm not sure that everybody would appreciate such unexpected behavior... maybe a system property to toggle whether it happens or not?

Yes, a system property is a good idea.

Regards,
Roger Lacroix
RogerLacroix
 
Posts: 6
Joined: Tue Sep 29, 2009 3:17 pm
Location: London, ON Canada

Re: Office LnFs bugs

Postby RogerLacroix » Fri Jun 29, 2012 11:44 pm

Hello Robert,

How are you doing on issues # 2, 3 and 4?

Regards,
Roger Lacroix
RogerLacroix
 
Posts: 6
Joined: Tue Sep 29, 2009 3:17 pm
Location: London, ON Canada

Re: Office LnFs bugs

Postby robert » Tue Jul 03, 2012 12:59 pm

Unfortunately no, but I'll take another look.
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm

Re: Office LnFs bugs

Postby RogerLacroix » Thu Nov 01, 2012 11:35 pm

Hello Robert,

Any updates on the issues?

Regards,
Roger Lacroix
RogerLacroix
 
Posts: 6
Joined: Tue Sep 29, 2009 3:17 pm
Location: London, ON Canada

Re: Office LnFs bugs

Postby robert » Wed Nov 14, 2012 3:50 am

Nothing yet, sorry. Patches are welcome!
User avatar
robert
 
Posts: 805
Joined: Sat May 10, 2008 5:16 pm


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron