Author Topic: Probable bug with text alignment in tabs of skins  (Read 11940 times)

0 Members and 1 Guest are viewing this topic.

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Probable bug with text alignment in tabs of skins
« on: March 18, 2012, 01:17:45 pm »
Hi,
developing a skin with tabs I found a probable Bug with the text alignment in tabs (description and comments).
Included I have a very simple skin with two tabs. The first tab presents a misalignment of the text. The second tab however presents a correct formatting of the text. The misalignment doesn't vanish neither with a refresh nor with a restart of PVD. The same misalignment (same column width) PVD shows regulary with normal skins without tabs during daily operation (usually in the description field), but it is more casual and not easily reproducable. In the sample skin however it is always present.

The sample skin contains nearly all borders of sections and columns to reveal the structure.

Thanks

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<xml>
  <pvd_skin_movie>
    <skinname>PVD Bug 2</skinname>
    <version>1.0.0.0</version>
    <author>goddert</author>
    <description>Skin with bug in tabs</description>
    <section space="15">
      <row>
        <column valign="top" space="15" width="35%">
          <section>
            <color>$000000</color>
            <border shape="none"/>
            <row>
              <column valign="top" halign="center">
                <section space="5">
                  <color>$ffffff</color>
                  <border shape="none"/>
                  <row>
                    <column space="5">
                      <poster autosize="true"/>
                    </column>
                  </row>
                </section>
              </column>
            </row>
          </section>
        </column>

        <column valign="top" halign="center">
          <section>
            <row>
              <column valign="center" halign="left">
                <section permanent="true">
                  <row>
                    <column valign="top" halign="left">
                      <origtitle>
                      </origtitle>
                    </column>
                  </row>
                </section>
              </column>
            </row>
            <row>
              <column valign="center" halign="left">
                <pagecontrol>
                  <tab>
                    <caption>Description</caption>
                    <row>
                      <column>
                        <description>
                        </description>
                      </column>
                    </row>
                  </tab>
                  <tab>
                    <caption>Critics</caption>
                    <row>
                      <column>
                        <comment>
                        </comment>
                      </column>
                    </row>
                  </tab>
                </pagecontrol>
              </column>
            </row>
          </section>
        </column>
      </row>
    </section>
  </pvd_skin_movie>
</xml>

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Probable bug with text alignment in tabs of skins
« Reply #1 on: March 18, 2012, 08:27:33 pm »
It works fine for me in both 0.9.9.21 and 1.0.2.2, Win 7 x64. Maybe a screenshot would help.

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Probable bug with text alignment in tabs of skins
« Reply #2 on: March 18, 2012, 09:30:26 pm »
You're right. I should have thought before to include some screenshot.

1. wrong wrapped text with example skin (first tab)



2. correct wrapped text with example skin (second tab)



3. wrong wrapped text with another skin (without tabs). This wrong wrapped text is corrected only by changing the movie.



System is Windows 7 64bit and PVD version 1.0.2.2. The last one I had also with version 0.9.9.21. Tomorrow I'll test it on a XPSP3 32bit. But I don't think it depends on the Windows version or even the graphic card.

Thanks

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Probable bug with text alignment in tabs of skins
« Reply #3 on: March 18, 2012, 11:42:27 pm »
Okay, I do see this occasionally—in the same way you mentioned originally. It happens often when changing skins, and is usually fixed by changing movies and/or expanding and collapsing all fields (I'm not sure, but maybe only collapsible fields are affected), but sometimes requires a restart. But it's not happening with your tabbed skin for me. Something else must be different...

To check if it has something to do with the configuration, rename your pvdconf.ini file, then start PVD. Test to see if the behaviour is different with the default configuration. If that makes no difference, test the behaviour with a new database. (When done, you can replace the new pvdconf.ini with the original one.)

Why do you think it's not related to the graphics card? You're probably right—I've never seen any difference after updating my driver.

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Probable bug with text alignment in tabs of skins
« Reply #4 on: March 19, 2012, 08:23:53 pm »
You were right. Cancelling the pvd.ini resolved the problem. Thank you Rick.
I'm a bit annoyed with myself that I didn't think about this before. Maybe because I didn't associate the settings in configuration file to the skin visualization. First I had some doubt not seeing the problem on an XPSP3 system today. The graphic card I excluded from the start as it usually works on a pixel level (also because as you can see clearly in the screenshots that the column width of the description is changing which, as a consequence, makes going wrong the text wrapping)

I try to nail down which setting is provoking the error and report it.

Thanks again

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Probable bug with text alignment in tabs of skins
« Reply #5 on: March 19, 2012, 10:03:12 pm »
Strange ...
It doesn't seem to depend on the pvdconf.ini. Now although I start PVD without any pvdconf.ini and I change only the skin as preference, with the skin attached to this post I have the same problem with the wrong text wrapping. Rick could please do me a favour and test the attached skin and tell me whether you see the behaviour shown in the first two screenshots?

Thanks

[attachment deleted by admin]

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Probable bug with text alignment in tabs of skins
« Reply #6 on: March 19, 2012, 11:26:03 pm »
Quote
Rick could please do me a favour and test the attached skin and tell me whether you see the behaviour shown in the first two screenshots?

It initially shows Description in a narrow column, but will the text intact (i.e., properly wrapped, not truncated). The Comment tab uses the full width available. Description does so only after the skin is reloaded (i.e., refreshing or changing movies does not).

It doesn't happen after all the rows above the tabbed section are deleted. Somehow, it seems to be picking up a column width from the previous section—in this case, that set for IMDb Rating. :-\

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Probable bug with text alignment in tabs of skins
« Reply #7 on: March 20, 2012, 09:07:27 am »
Thank you.

It behaves sligthly different on my system. The description tab is never correct and always in form of the narrow column. Neither a restart nor refreshing etc. does help.

These were the good news.

On a XPSP3 32bit system the error doesn't occur with the skin above ...  :o

But ... I could reproduce the "narrow column" with another tab skin and one of my other skins (3. screenshot).

It occurs only with expandable sections and with every skin it behaves differently. In the end when I could reproduce the error with one skin it was sufficient to keep the MovieExpanded settings in the [UI] section of pvdconf.ini, delete the configuration file, copy the MovieExpanded settings to make appear the error again. Which means it depends on the combination of already expanded sections during the visualization of the skin. This would explain why deleting the pvdconf.ini initially resolved the problem for me.

But it doesn't explain the different behaviour on different systems and why the bug with my Windows 7 64bit system also without a pvdconf.ini produces the bug (except the initial setting MovieExpanded of virgin pvdconf.ini was provoking the bug there)

Edit: I forgot something. It is not the column width of the previous column it picks. The width doesn't correspond to any other column width in the skin. But ... the width seems to be the same through all the skins which produce the error. Maybe it is some default width it uses.
« Last Edit: March 20, 2012, 09:12:38 am by goddert »

mgpw4me

  • Guest
Re: Probable bug with text alignment in tabs of skins
« Reply #8 on: March 22, 2012, 07:34:10 pm »
<guessing>

Assuming PVD (er, Delphi) uses the MSXML library for parsing, there are different versions available.  A quick look at your windows/system32 directory should tell you which versions you have loaded (3,4 and 6, being likely for 64 bit and 3,4 for 32 bit...and 6 on XP SP3 or later).  If these DLLs are the same on all systems, I'm out of ideas for the differences.

The narrow left column can't be reproduced on my system...Vista 32 bit (MSXML versions 3,4,6) and PVD 0.9.9.21.  It does make sense to me though...

The control tries to use the minimal amount of space because it's being autosized.  For a title, it would use the minimal width necessary to display the title.  For a multi-line display, it makes sense to look at the height of the page, then make the control's width whatever is necessary to fit the text into the display.  This would account for differences encountered with expandable fields. 

Rick's comment that a refresh resolves the issue also makes sense, if the parser invokes the renderer in real time...the renderer won't know about other tabs or columns that might occur later in the XML code.  Once the page has been parsed once, all the page elements are known, so the renderer can make a better decision.

</guessing>

The obvious fix would be to assign a width to the control or to one of it's parent containers (page control would be my preference).  If that works, it doesn't mean there isn't a problem, just that there's a work-around for it.

[attachment deleted by admin]

Offline goddert

  • User
  • ***
  • Posts: 39
    • View Profile
Re: Probable bug with text alignment in tabs of skins
« Reply #9 on: March 23, 2012, 05:51:29 pm »
@mgpw4me

Thanks for your answer. I'm not completely convinced by your guessing, for various reasons.

As far as I know PVD doesn't use the msxml* libraries and I'm not really sure whether it uses implicitly a xml library. It uses the mshtml.dll and therefore xmllite.dll. (btw I have on both systems only version 3 and 6 of the msxml* libraries - these are the ones that are necessary for parsing xml with windows (32 or 64) if you want to link them, 4 often is installed but not used).

But apart from this the control in question is not autosized. The poster control is autosized, the description and also all father objects aren't. (Autosize that is to say the poster fills all space available inside the 35% column/row) If you remove autosize from the poster the misalignment appears nevertheless. Or did you mean autosized by the PVD window? In this case it should occupy all the available horizontal space of the father column (obviously to the side of the poster) because there isn't defined a size for the column. Indeed the comments tab does it correctly (horizontally expanded til the border of the father column).

Quote
For a multi-line display, it makes sense to look at the height of the page, then make the control's width whatever is necessary to fit the text into the display.
If this was the case you'd have a column with one word in every line if the text doesn't fit the height. It is not the way renderers work (at least in the occidental world :) Every browser is the proof.

Also putting a fixed width doesn't resolve the problem. In fact in the meanwhile I could reproduce the problem with both systems and various skins (see screenshot). As I said above, once discovered the guilty state of the values of MovieExpanded for a skin I can reproduce it.

I think the only answer can give us nostra when he will find a bit time to investigate the problem.

Thanks

VinT skin:

mgpw4me

  • Guest
Re: Probable bug with text alignment in tabs of skins
« Reply #10 on: March 23, 2012, 10:32:55 pm »
I agree that your logic is preferable over mine as per standards compliant scaling when a width is not defined...horizontal bias.  I wouldn't bet the farm on it (I'd keep the house in reserve), but I like your logic.  If a single scaling routine is used for all controls, it would be difficult to produce HTML standards compliant displays.

My goal is to ensure Nostra gets the best information we can give to reduce the time he has to spend on it.  Less time for the small user base affected would mean a greater chance of getting it fixed in the near future.

Summary of important factors to date:
- 64 bit OS makes it easier to reproduce
- expandable fields affect the display
- refresh doesn't fix it
- setting a width doesn't fix it

Did you crop the scrollbars in your images?  With expanded expandable fields, it looks like the text area should fill the narrow column all the way to the bottom of the page (the basis of my guessing).

I'm going to bow out of this thread now.  I'll watch it for progress, but don't see where I can contribute further.