Archive: Help -> nsDiaglogs issue: some label is overlap in second page


Help -> nsDiaglogs issue: some label is overlap in second page
  I use created 2 custom pages by nsDialogs.nsh. The first show the label, button and link very well. But after go to next page, the label looks like be overlapped by some other controls.
I post the code and the sreenshort here, someone please take a look and give me some idea how to solve it.
Thanks!

The first page show the Window Installer 3.1 installation:
==========================================================
nsDialogs::Create /NOUNLOAD 1018
Pop $WindowsInstallerDialogHandle

${If} error == $WindowsInstallerDialogHandle
Abort
${EndIf}

${NSD_CreateIcon} 5u 8u -40u 31u

${NSD_CreateLabel} 40u 8u -40u 31u "$(WindowsInstallerIniField2Text)"
Pop $WindowsInstallerInfoLabelHandle

${NSD_CreateLabel} 40u 28u -40u 31u "$(WindowsInstallerIniField3Text)"
Pop $SecondInstallerInfoLabelHandle

Call IsWindows3Dot1RedistibutablePresent
Pop $0
${If} 1 == $0
; show button
${NSD_CreateButton} 60u 93u 144u 14u "$(WindowsInstallerIniField5Text)"
Pop $WinInstallerFromDiskButtonHandle
${NSD_OnClick} $WinInstallerFromDiskButtonHandle InstallWindows3Dot1 ; button clicked event
${EndIf}

${NSD_CreateLink} 60u 72u -40u 10u "$(WindowsInstallerIniField4Text)"
Pop $WinInstallerLinkHandle
${NSD_OnClick} $WinInstallerLinkHandle OnWindowsInstallerLinkClicked

; Show the dialog
nsDialogs::Show
Return
============================================================

The second page show the .NET 3.5 installation:
============================================================
nsDialogs::Create /NOUNLOAD 1018
Pop $DotNetDialogHandle

${If} error == $DotNetDialogHandle
Abort
${EndIf}

${NSD_CreateIcon} 5u 9u -40u 31u

${NSD_CreateLabel} 40u 9u -40u 31u "$(DotNet3IniField2Text)"
Pop $DotNetInfoLabelHandle

${NSD_CreateLabel} 40u 30u -40u 31u "$(DotNet3IniField3Text)"
Pop $SecondDotNetInfoLabelHandle

Call IsDotNet3RedistibutablePresent
Pop $0
${If} 1 == $0
; show button
${NSD_CreateButton} 60u 91u 144u 14u "$(DotNet3IniField5Text)"
Pop $NetFromDiskButtonHandle
${NSD_OnClick} $NetFromDiskButtonHandle InstallDotNet3 ; button clicked event
${EndIf}

${NSD_CreateLink} 60u 70u -40u 10u "$(DotNet3IniField4Text)"
Pop $NetFromLinkHandle
${NSD_OnClick} $NetFromLinkHandle OnDotNetOnLinkClicked

; Show the dialog
nsDialogs::Show
Return
============================================================


As best as I can tell, you are seeing the exact same bug that I am seeing.

This really seems to be a NSIS/nsDialogs redraw issue. I don't think that there is anything that we can do about it unless it is fixed in the code.


In the last 2 days, I have actively fighting with this issue. The common point seems to be that for the first Label control on the first nsDialogs custom page, that label will eventually turn invisible. It feels like a redraw issue as you can drag another window over the misbehaving installer window and you will see your label text come back.

Today, at the suggestion of one of our programmers, his idea has actually solved the problem, but I doubt it is a good permanent fix and that the true bug is still hidden. For now, this solution works for us and I wanted to post about it here to get some feedback.

Our programmer remembered a problem a year ago or so with a Windows app that was having a similar label redraw issue and the solution ended up being to remove the EX Transparent style from the control. nsDialogs sets this extended style for label controls. What we did was go into the nsDialogs.nsh file and comment out line 189:

!define __NSD_Label_EXSTYLE ${WS_EX_TRANSPARENT} 
We now have two different installers who's first-nsDialogs-label-disappearing bug no longer occurs.

So, how do we go about getting this fixed properly?

Sorry, the commenting out of the line was a dumb move, as it just caused warnings. We have since changed the line to


define __NSD_Label_EXSTYLE 0 

>
So, any ideas on how to address this issue properly? Anyone?

You might want to submit this as a bug report in the bug tracker?

http://nsis.sourceforge.net/Bug_Reports


Wow, I feel dumb now. I was looking for the bug link, but I think I kept searching for "tracker". /selfsmack

I will get this filed tomorrow. Thanks MSG!


OK, bugs filed. Thanks for the help MSG.


Don't mean to resurrect this super-old thread - but I was going to log a bug and noticed this one in the queue there.
One way to make this 'bug' show up is by moving the window off-screen, them moving it back on-screen.. forcing a repaint of the dialog, and making the portions disappear.

I say 'bug' because you mention...

Originally posted by yudyzhao
I use created 2 custom pages by nsDialogs.nsh. The first show the label, button and link very well. But after go to next page, the label looks like be overlapped by some other controls.
What makes you think that the controls are, in fact, not overlapped?
If you replace CreateLabel with CreateButton, you can check the bounds of the control you're creating.. and you'll see that they do overlap.

That said.. I don't see the first label disappearing - it's the second one that goes away for me - so it might be unrelated.

Could you be using mouse driver ipoint.exe v6.1? That caused redraw issues for me until I updated it to v7 (see this thread)

Don


Yes, one control covers another:

${NSD_CreateLabel} 40u 8u -40u 31u "$(WindowsInstallerIniField2Text)"
Pop $WindowsInstallerInfoLabelHandle

8+31=39, but the following top is only 28:

${NSD_CreateLabel} 40u 28u -40u 31u "$(WindowsInstallerIniField3Text)"
Pop $SecondInstallerInfoLabelHandle

and the second one also:

${NSD_CreateLabel} 40u 9u -40u 31u "$(DotNet3IniField2Text)"
Pop $DotNetInfoLabelHandle

31+9=40, but top position of next control is 30:

${NSD_CreateLabel} 40u 30u -40u 31u "$(DotNet3IniField3Text)"
Pop $SecondDotNetInfoLabelHandle