Archive: Read-only checkbox on custom page


Read-only checkbox on custom page
Hello,

I am trying to display the chosen components on a summary page. I use checkboxes to do this:

${NSD_CreateCheckBox} 0 44u 100% 12u "Component 1"
Pop $chkComp1
${If} ${SectionIsSelected} ${Section1}
${NSD_Check} $chkComp1
${EndIf}


Is it possible to set the checkbox read-only? I did this with a textbox:
${NSD_CreateText} 0 13u 100% 12u $(summary_text_path)
Pop $txtPath
SendMessage $txtPath ${EM_SETREADONLY} 1 0

http://nsis.sourceforge.net/NsDialog...y_Text_control

Unfortunately it seems not to work with checkboxes.

Another idea I had was disabling the checkboxes (EnableWindow $chkComp1 0), but this grays out the boxes and the caption and I don't like the look of it.

My third idea would be using images of checkboxes and putting them next to labels, but I think there is a better way to do this.

Can someone help me out? Thanks in advance!

Quick idea: what about placing other control (which support transparency 0 label, image, ...) over your checkbox?
User will not be able to click the checkbox as control above it will catch the event.


Originally posted by T.Slappy
Quick idea: what about placing other control (which support transparency 0 label, image, ...) over your checkbox?
User will not be able to click the checkbox as control above it will catch the event.
That is not a good idea because the user can use Tab to access the control and then Space to change its state.

If you want a read-only check box then I would advise disabling it. This is what the user expects and not having it disabled will probably result in people thinking it's a bug.

Stu

Originally posted by Afrow UK
If you want a read-only check box then I would advise disabling it. This is what the user expects and not having it disabled will probably result in people thinking it's a bug.
That's a very good point.

Now I'm going to create the checkboxes (disabled) with empty strings as caption and put labels next to them. Then the checkboxes are disabled, but the text remains black.

Thanks to both of you for your help.

Originally posted by Afrow UK
That is not a good idea because the user can use Tab to access the control and then Space to change its state.

Stu
You could remove the WS_TABSTOP style from the checkbox